@@ -607,17 +607,17 @@ def getoutput(cmd):
607
607
608
608
609
609
def _use_posix_spawn ():
610
- """Check is posix_spawn() can be used for subprocess.
610
+ """Check if posix_spawn() can be used for subprocess.
611
611
612
- subprocess requires a posix_spawn() implementation that reports properly
613
- errors to the parent process, set errno on the following failures:
612
+ subprocess requires a posix_spawn() implementation that properly reports
613
+ errors to the parent process, & sets errno on the following failures:
614
614
615
- * process attribute actions failed
616
- * file actions failed
617
- * exec() failed
615
+ * Process attribute actions failed.
616
+ * File actions failed.
617
+ * exec() failed.
618
618
619
- Prefer an implementation which can use vfork in some cases for best
620
- performances .
619
+ Prefer an implementation which can use vfork() in some cases for best
620
+ performance .
621
621
"""
622
622
if _mswindows or not hasattr (os , 'posix_spawn' ):
623
623
# os.posix_spawn() is not available
@@ -642,15 +642,14 @@ def _use_posix_spawn():
642
642
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
643
643
# which properly reports errors to the parent process.
644
644
return True
645
- # Note: Don't use the POSIX implementation of glibc because it doesn't
645
+ # Note: Don't use the implementation in earlier glibc because it doesn't
646
646
# use vfork (even if glibc 2.26 added a pipe to properly report errors
647
647
# to the parent process).
648
648
except (AttributeError , ValueError , OSError ):
649
649
# os.confstr() or CS_GNU_LIBC_VERSION value not available
650
650
pass
651
651
652
- # By default, consider that the implementation does not properly report
653
- # errors.
652
+ # By default, assume that posix_spawn() does not properly report errors.
654
653
return False
655
654
656
655
0 commit comments