mirror of
https://github.com/python/cpython.git
synced 2025-10-03 05:35:59 +00:00
Fix docstr/comment typos in _use_posix_spawn(). (GH-11684)
This commit is contained in:
parent
d8080c0119
commit
81d04bcf21
1 changed files with 10 additions and 11 deletions
|
@ -607,17 +607,17 @@ def getoutput(cmd):
|
||||||
|
|
||||||
|
|
||||||
def _use_posix_spawn():
|
def _use_posix_spawn():
|
||||||
"""Check is posix_spawn() can be used for subprocess.
|
"""Check if posix_spawn() can be used for subprocess.
|
||||||
|
|
||||||
subprocess requires a posix_spawn() implementation that reports properly
|
subprocess requires a posix_spawn() implementation that properly reports
|
||||||
errors to the parent process, set errno on the following failures:
|
errors to the parent process, & sets errno on the following failures:
|
||||||
|
|
||||||
* process attribute actions failed
|
* Process attribute actions failed.
|
||||||
* file actions failed
|
* File actions failed.
|
||||||
* exec() failed
|
* exec() failed.
|
||||||
|
|
||||||
Prefer an implementation which can use vfork in some cases for best
|
Prefer an implementation which can use vfork() in some cases for best
|
||||||
performances.
|
performance.
|
||||||
"""
|
"""
|
||||||
if _mswindows or not hasattr(os, 'posix_spawn'):
|
if _mswindows or not hasattr(os, 'posix_spawn'):
|
||||||
# os.posix_spawn() is not available
|
# os.posix_spawn() is not available
|
||||||
|
@ -642,15 +642,14 @@ def _use_posix_spawn():
|
||||||
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
|
# glibc 2.24 has a new Linux posix_spawn implementation using vfork
|
||||||
# which properly reports errors to the parent process.
|
# which properly reports errors to the parent process.
|
||||||
return True
|
return True
|
||||||
# Note: Don't use the POSIX implementation of glibc because it doesn't
|
# Note: Don't use the implementation in earlier glibc because it doesn't
|
||||||
# use vfork (even if glibc 2.26 added a pipe to properly report errors
|
# use vfork (even if glibc 2.26 added a pipe to properly report errors
|
||||||
# to the parent process).
|
# to the parent process).
|
||||||
except (AttributeError, ValueError, OSError):
|
except (AttributeError, ValueError, OSError):
|
||||||
# os.confstr() or CS_GNU_LIBC_VERSION value not available
|
# os.confstr() or CS_GNU_LIBC_VERSION value not available
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# By default, consider that the implementation does not properly report
|
# By default, assume that posix_spawn() does not properly report errors.
|
||||||
# errors.
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue