Skip to content

Commit 816697a

Browse files
committed
Allow 'preexec_fn' and 'creationflags' keywords
which will be passed through to the subprocess call
1 parent 8cdd12f commit 816697a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
History
33
=======
44

5+
2.3.3 (2022-03-23)
6+
------------------
7+
* Allow specifying 'preexec_fn' and 'creationflags' keywords, which will be passed through to
8+
the subprocess call
9+
510
2.3.2 (2022-01-28)
611
------------------
712
* The run() function now understands stdin=subprocess.DEVNULL to close the subprocess stdin,

procrunner/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,8 @@ def run(
445445
win32resolve=True,
446446
working_directory=None,
447447
raise_timeout_exception=False,
448+
creationflags=0,
449+
preexec_fn=None,
448450
):
449451
"""
450452
Run an external process.
@@ -477,6 +479,8 @@ def run(
477479
instead of returning an object that can be checked
478480
for a timeout condition. Defaults to False, will be
479481
changed to True in a future release.
482+
:param preexec_fn: pre-execution function, will be passed to subprocess call
483+
:param creationflags: flags that will be passed to subprocess call
480484
:return: The exit code, stdout, stderr (separately, as byte strings)
481485
as a subprocess.CompletedProcess object.
482486
"""
@@ -536,6 +540,8 @@ def run(
536540
stdin=stdin_pipe,
537541
stdout=subprocess.PIPE,
538542
stderr=subprocess.PIPE,
543+
creationflags=creationflags,
544+
preexec_fn=preexec_fn,
539545
)
540546

541547
thread_pipe_pool = []

0 commit comments

Comments
 (0)