[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@gmail.com>
Automerge-Triggered-By: GH:gpshead
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 8203ade..ccb46a6 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