diff Lib/subprocess.py @ 81022:a963dd401a63 2.7

Keep ref to ECHILD in local scope (#16650)
author Andrew Svetlov <andrew.svetlov@gmail.com>
date Mon, 24 Dec 2012 20:09:27 +0200
parents 2bdd984a55ac
children 37f52e71f4cd
line wrap: on
line diff
--- a/Lib/subprocess.py	Mon Dec 24 16:33:18 2012 +0000
+++ b/Lib/subprocess.py	Mon Dec 24 20:09:27 2012 +0200
@@ -1292,7 +1292,7 @@
 
 
         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.
 
@@ -1308,7 +1308,7 @@
                 except _os_error as e:
                     if _deadstate is not None:
                         self.returncode = _deadstate
-                    if e.errno == errno.ECHILD:
+                    if 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