mirror of
https://github.com/python/cpython.git
synced 2025-09-27 18:59:43 +00:00
Keep ref to ECHILD in local scope (#16650)
This commit is contained in:
parent
9fade768c8
commit
332562f447
1 changed files with 2 additions and 2 deletions
|
@ -1292,7 +1292,7 @@ class Popen(object):
|
||||||
|
|
||||||
|
|
||||||
def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
|
def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
|
||||||
_WNOHANG=os.WNOHANG, _os_error=os.error):
|
_WNOHANG=os.WNOHANG, _os_error=os.error, _ECHILD=errno.ECHILD):
|
||||||
"""Check if child process has terminated. Returns returncode
|
"""Check if child process has terminated. Returns returncode
|
||||||
attribute.
|
attribute.
|
||||||
|
|
||||||
|
@ -1308,7 +1308,7 @@ class Popen(object):
|
||||||
except _os_error as e:
|
except _os_error as e:
|
||||||
if _deadstate is not None:
|
if _deadstate is not None:
|
||||||
self.returncode = _deadstate
|
self.returncode = _deadstate
|
||||||
if e.errno == errno.ECHILD:
|
if e.errno == _ECHILD:
|
||||||
# This happens if SIGCLD is set to be ignored or
|
# This happens if SIGCLD is set to be ignored or
|
||||||
# waiting for child processes has otherwise been
|
# waiting for child processes has otherwise been
|
||||||
# disabled for our process. This child is dead, we
|
# disabled for our process. This child is dead, we
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue