Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Lib/subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,9 @@ def _use_posix_spawn():
# os.posix_spawn() is not available
return False

if ((_env := os.environ.get('_PYTHON_SUBPROCESS_USE_POSIX_SPAWN')) in ('0', '1')):
return bool(int(_env))

if sys.platform in ('darwin', 'sunos5'):
# posix_spawn() is a syscall on both macOS and Solaris,
# and properly reports errors
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Introduce new ``_PYTHON_SUBPROCESS_USE_POSIX_SPAWN`` environment variable knob in
:mod:`subprocess` to control the use of :func:`os.posix_spawn`.
Loading