From b1930bf75f276cd7ca08c4455298128d89adf7d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Kul=C3=ADk?= Date: Tue, 17 Aug 2021 20:09:48 +0200 Subject: [PATCH] bpo-44935: enable posix_spawn() on Solaris (GH-27795) Enable posix_spawn() on Solaris --- Lib/subprocess.py | 5 +++-- .../next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2021-08-17-16-01-44.bpo-44935.roUl0G.rst diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 7a9ab5a4ed0..dd1174ee59a 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 00000000000..3d41c3be140 --- /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.