[Python-checkins] [3.10] bpo-44935: enable posix_spawn() on Solaris (GH-27795) (GH-27800)
miss-islington
webhook-mailer at python.org
Tue Aug 17 14:33:43 EDT 2021
https://github.com/python/cpython/commit/826e059bb9b42e17bef2186938a2bd3f33610e69
commit: 826e059bb9b42e17bef2186938a2bd3f33610e69
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-08-17T11:33:34-07:00
summary:
[3.10] bpo-44935: enable posix_spawn() on Solaris (GH-27795) (GH-27800)
Enable posix_spawn() on Solaris
(cherry picked from commit b1930bf75f276cd7ca08c4455298128d89adf7d1)
Co-authored-by: Jakub Kulík <Kulikjak at gmail.com>
Automerge-Triggered-By: GH:gpshead
files:
A Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst
M Lib/subprocess.py
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 8203aded7d552..ccb46a6337b3d 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -660,8 +660,9 @@ def _use_posix_spawn():
# os.posix_spawn() is not available
return False
- if sys.platform == 'darwin':
- # posix_spawn() is a syscall on macOS and properly reports errors
+ if sys.platform in ('darwin', 'sunos5'):
+ # posix_spawn() is a syscall on both macOS and Solaris,
+ # and properly reports errors
return True
# Check libc name and runtime libc version
diff --git a/Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst b/Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst
new file mode 100644
index 0000000000000..3d41c3be1403d
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst
@@ -0,0 +1,2 @@
+:mod:`subprocess` on Solaris now also uses :func:`os.posix_spawn()` for
+better performance.
More information about the Python-checkins
mailing list