Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08bab07

Browse files
committed
Keep ref to ECHILD in local scope (#16650)
1 parent 8a495a4 commit 08bab07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/subprocess.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
14111411

14121412

14131413
def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
1414-
_WNOHANG=os.WNOHANG, _os_error=os.error):
1414+
_WNOHANG=os.WNOHANG, _os_error=os.error, _ECHILD=errno.ECHILD):
14151415
"""Check if child process has terminated. Returns returncode
14161416
attribute.
14171417
@@ -1427,7 +1427,7 @@ def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
14271427
except _os_error as e:
14281428
if _deadstate is not None:
14291429
self.returncode = _deadstate
1430-
elif e.errno == errno.ECHILD:
1430+
elif e.errno == _ECHILD:
14311431
# This happens if SIGCLD is set to be ignored or
14321432
# waiting for child processes has otherwise been
14331433
# disabled for our process. This child is dead, we

0 commit comments

Comments
 (0)