[Python-checkins] cpython (merge 3.2 -> 3.3): Keep ref to ECHILD in local scope (#16650)

andrew.svetlov python-checkins at python.org
Mon Dec 24 19:09:41 CET 2012


http://hg.python.org/cpython/rev/0b1a49f99169
changeset:   81020:0b1a49f99169
branch:      3.3
parent:      81010:10656b0975b3
parent:      81019:0cc4fe5634cf
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Mon Dec 24 20:06:52 2012 +0200
summary:
  Keep ref to ECHILD in local scope (#16650)

files:
  Lib/subprocess.py |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Lib/subprocess.py b/Lib/subprocess.py
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1452,7 +1452,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.
 
@@ -1468,7 +1468,7 @@
                 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

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list