From: Andrew Svetlov Date: Mon, 24 Dec 2012 18:08:53 +0000 (+0200) Subject: Keep ref to ECHILD in local scope (#16650) X-Git-Tag: v3.4.0a1~1784 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d960fe4c4235907cdd056e09d19aa2c0963b4b5;p=python Keep ref to ECHILD in local scope (#16650) --- 1d960fe4c4235907cdd056e09d19aa2c0963b4b5 diff --cc Lib/subprocess.py index 0c60be122d,aa3e21754e..fd5104891c --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@@ -1412,7 -1452,7 +1412,7 @@@ class Popen(object) def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid, - _WNOHANG=os.WNOHANG): - _WNOHANG=os.WNOHANG, _os_error=os.error, _ECHILD=errno.ECHILD): ++ _WNOHANG=os.WNOHANG, _ECHILD=errno.ECHILD): """Check if child process has terminated. Returns returncode attribute. @@@ -1425,10 -1465,10 +1425,10 @@@ pid, sts = _waitpid(self.pid, _WNOHANG) if pid == self.pid: self._handle_exitstatus(sts) - except _os_error as e: + except OSError 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