]> granicus.if.org Git - python/commitdiff
Keep ref to ECHILD in local scope (#16650)
authorAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 24 Dec 2012 18:06:35 +0000 (20:06 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 24 Dec 2012 18:06:35 +0000 (20:06 +0200)
Lib/subprocess.py

index a3228294693bcc181bf0f6213e753422f1970b64..f32f081e97dad77670aae8b7d01198ce0588b83a 100644 (file)
@@ -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