diff options
author | Victor Stinner <vstinner@redhat.com> | 2019-01-16 00:02:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-16 00:02:35 +0100 |
commit | 9daecf37a571e98aaf43a387bcc9e41a7132f477 (patch) | |
tree | 845a37230f2a9d6eed12a4fc84727394ad323d68 /Lib/test/pythoninfo.py | |
parent | a37f52436f9aa4b9292878b72f3ff1480e2606c3 (diff) | |
download | cpython-git-9daecf37a571e98aaf43a387bcc9e41a7132f477.tar.gz |
bpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)
The subprocess module can now use the os.posix_spawn() function
in some cases for better performance. Currently, it is only used on macOS
and Linux (using glibc 2.24 or newer) if all these conditions are met:
* executable path contains a directory
* close_fds=False
* preexec_fn, pass_fds, cwd, stdin, stdout, stderr
and start_new_session parameters are not set
Co-authored-by: Joannah Nanjekye <nanjekyejoannah@gmail.com>
Diffstat (limited to 'Lib/test/pythoninfo.py')
-rw-r--r-- | Lib/test/pythoninfo.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/pythoninfo.py b/Lib/test/pythoninfo.py index 7ce6bf7b1a..7e94a31cec 100644 --- a/Lib/test/pythoninfo.py +++ b/Lib/test/pythoninfo.py @@ -610,6 +610,11 @@ def collect_get_config(info_add): info_add('%s[%s]' % (prefix, key), repr(config[key])) +def collect_subprocess(info_add): + import subprocess + copy_attributes(info_add, subprocess, 'subprocess.%s', ('_USE_POSIX_SPAWN',)) + + def collect_info(info): error = False info_add = info.add @@ -639,6 +644,7 @@ def collect_info(info): collect_cc, collect_gdbm, collect_get_config, + collect_subprocess, # Collecting from tests should be last as they have side effects. collect_test_socket, |