]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-44935: enable posix_spawn() on Solaris (GH-27795)
authorJakub Kulík <Kulikjak@gmail.com>
Tue, 17 Aug 2021 18:09:48 +0000 (20:09 +0200)
committerGitHub <noreply@github.com>
Tue, 17 Aug 2021 18:09:48 +0000 (11:09 -0700)
Enable posix_spawn() on Solaris

Lib/subprocess.py
Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst [new file with mode: 0644]

index 7a9ab5a4ed0ecefed4d054f912016be5da547bd3..dd1174ee59ad3b880afdbfcfe3f5035c64a20ba5 100644 (file)
@@ -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 (file)
index 0000000..3d41c3b
--- /dev/null
@@ -0,0 +1,2 @@
+:mod:`subprocess` on Solaris now also uses :func:`os.posix_spawn()` for
+better performance.