Skip to content

Commit 41313de

Browse files
committed
Merge branch 'flag-forwarding'
2 parents 8cc8921 + f15aaa5 commit 41313de

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 2.3.2
2+
current_version = 2.3.3
33
commit = True
44
tag = True
55

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ History
1616
* The run() function no longer accepts a 'debug' argument
1717
(previously deprecated in `#63 <https://github.com/DiamondLightSource/python-procrunner/pull/63>`_)
1818

19+
2.3.3 (2022-03-23)
20+
------------------
21+
* Allow specifying 'preexec_fn' and 'creationflags' keywords, which will be passed through to
22+
the subprocess call
23+
1924
2.3.2 (2022-01-28)
2025
------------------
2126
* The run() function now understands stdin=subprocess.DEVNULL to close the subprocess stdin,

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
name = procrunner
33
description = Versatile utility function to run external processes
4-
version = 2.3.2
4+
version = 2.3.3
55
author = Diamond Light Source - Scientific Software et al.
66
author_email = [email protected]
77
classifiers =

src/procrunner/__init__.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
# stderr=b'/bin/ls: cannot access /some/path/containing spaces: No such file or directory\n'
4747
# )
4848

49-
__version__ = "2.3.2"
49+
__version__ = "2.3.3"
5050

5151
logger = logging.getLogger("procrunner")
5252
logger.addHandler(logging.NullHandler())
@@ -304,16 +304,18 @@ def run(
304304
command,
305305
*,
306306
timeout: Optional[float] = None,
307-
stdin: Optional[Union[bytes, int]] = None,
308-
print_stdout: bool = True,
309-
print_stderr: bool = True,
310-
callback_stdout: Optional[Callable] = None,
311307
callback_stderr: Optional[Callable] = None,
308+
callback_stdout: Optional[Callable] = None,
309+
creationflags: int = 0,
312310
environment: Optional[dict[str, str]] = None,
313311
environment_override: Optional[dict[str, str]] = None,
312+
preexec_fn: Optional[Callable] = None,
313+
print_stderr: bool = True,
314+
print_stdout: bool = True,
315+
raise_timeout_exception: Any = ...,
316+
stdin: Optional[Union[bytes, int]] = None,
314317
win32resolve: bool = True,
315318
working_directory: Optional[str] = None,
316-
raise_timeout_exception: Any = ...,
317319
) -> subprocess.CompletedProcess:
318320
"""
319321
Run an external process.
@@ -331,9 +333,11 @@ def run(
331333
stdout line.
332334
:param callback_stderr: Optional function which is called for each
333335
stderr line.
336+
:param creationflags: flags that will be passed to subprocess call
334337
:param dict environment: The full execution environment for the command.
335338
:param dict environment_override: Change environment variables from the
336339
current values for command execution.
340+
:param preexec_fn: pre-execution function, will be passed to subprocess call
337341
:param boolean win32resolve: If on Windows, find the appropriate executable
338342
first. This allows running of .bat, .cmd, etc.
339343
files without explicitly specifying their
@@ -399,6 +403,8 @@ def run(
399403
stdin=stdin_pipe,
400404
stdout=subprocess.PIPE,
401405
stderr=subprocess.PIPE,
406+
creationflags=creationflags,
407+
preexec_fn=preexec_fn,
402408
)
403409

404410
thread_pipe_pool = []

0 commit comments

Comments
 (0)