diff options
author | Gregory P. Smith <greg@krypto.org> | 2022-05-01 23:09:50 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-01 23:09:50 (GMT) |
commit | ea1eba03e7e8401d5acf8b30b56b41faa209e8c6 (patch) | |
tree | 21d81eb6e2a87a1853e2fea2cd5d295574a2ec7e /Lib/subprocess.py | |
parent | e7de54321952ebb58cc414f2160c9ad4f6510af2 (diff) | |
download | cpython-ea1eba03e7e8401d5acf8b30b56b41faa209e8c6.zip cpython-ea1eba03e7e8401d5acf8b30b56b41faa209e8c6.tar.gz cpython-ea1eba03e7e8401d5acf8b30b56b41faa209e8c6.tar.bz2 |
[3.10] gh-91401: Conservative backport of `subprocess._USE_VFORK` (#91932)
This does not alter the `_posixsubprocess.fork_exec()` private API to
avoid issues for anyone relying on that (bad idea) or for anyone who's
`subprocess.py` and `_posixsubprocess.so` upgrades may not become
visible to existing Python 3.10 processes at the same time.
Backports the concept of cd5726fe674eaff442510eeb6c75628858be9e9f.
Provides a fail-safe way to disable vfork for #91401.
I didn't backport the documentation as I don't actually expect this to be used and `.. versionadded: 3.10.5` always looks weird in docs. It's being done more to have a fail-safe in place for people just in case.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r-- | Lib/subprocess.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index ccb46a6..a414321 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -691,7 +691,10 @@ def _use_posix_spawn(): return False +# These are primarily fail-safe knobs for negatives. A True value does not +# guarantee the given libc/syscall API will be used. _USE_POSIX_SPAWN = _use_posix_spawn() +_USE_VFORK = True class Popen: |