Skip to content

Commit 81d04bc

Browse files
authored
Fix docstr/comment typos in _use_posix_spawn(). (GH-11684)
1 parent d8080c0 commit 81d04bc

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

Lib/subprocess.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -607,17 +607,17 @@ def getoutput(cmd):
607607

608608

609609
def _use_posix_spawn():
610-
"""Check is posix_spawn() can be used for subprocess.
610+
"""Check if posix_spawn() can be used for subprocess.
611611
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:
614614
615-
* process attribute actions failed
616-
* file actions failed
617-
* exec() failed
615+
* Process attribute actions failed.
616+
* File actions failed.
617+
* exec() failed.
618618
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.
621621
"""
622622
if _mswindows or not hasattr(os, 'posix_spawn'):
623623
# os.posix_spawn() is not available
@@ -642,15 +642,14 @@ def _use_posix_spawn():
642642
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
643643
# which properly reports errors to the parent process.
644644
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
646646
# use vfork (even if glibc 2.26 added a pipe to properly report errors
647647
# to the parent process).
648648
except (AttributeError, ValueError, OSError):
649649
# os.confstr() or CS_GNU_LIBC_VERSION value not available
650650
pass
651651

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.
654653
return False
655654

656655

0 commit comments

Comments
 (0)