From 08bab072917c2eeea3a0f3da0546d57cf5072bcf Mon Sep 17 00:00:00 2001 From: Andrew Svetlov Date: Mon, 24 Dec 2012 20:06:35 +0200 Subject: Keep ref to ECHILD in local scope (#16650) --- Lib/subprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/subprocess.py b/Lib/subprocess.py index a322829..f32f081e 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1411,7 +1411,7 @@ class Popen(object): 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 attribute. @@ -1427,7 +1427,7 @@ class Popen(object): except _os_error as e: if _deadstate is not None: self.returncode = _deadstate - elif e.errno == errno.ECHILD: + elif e.errno == _ECHILD: # This happens if SIGCLD is set to be ignored or # waiting for child processes has otherwise been # disabled for our process. This child is dead, we -- cgit v0.12