Skip to content

Commit ecbdfad

Browse files
committed
Allow to pass FDs to executed programs in sio.workers.executors
1 parent fe273b8 commit ecbdfad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sio/workers/executors.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def execute_command(
7979
real_time_limit=None,
8080
ignore_errors=False,
8181
extra_ignore_errors=(),
82+
pass_fds=(),
8283
**kwargs
8384
):
8485
"""Utility function to run arbitrary command.
@@ -111,6 +112,9 @@ def execute_command(
111112
112113
``stdout``
113114
Only when ``capture_output=True``: output of the command
115+
116+
``pass_fds``
117+
Extra file descriptors to pass to the command.
114118
"""
115119
# Using temporary file is way faster than using subproces.PIPE
116120
# and it prevents deadlocks.
@@ -141,6 +145,7 @@ def execute_command(
141145
env=env,
142146
cwd=tempcwd(),
143147
preexec_fn=os.setpgrp,
148+
pass_fds=pass_fds,
144149
)
145150

146151
kill_timer = None

0 commit comments

Comments
 (0)