]> 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:08:53 +0000 (20:08 +0200)
committerAndrew Svetlov <andrew.svetlov@gmail.com>
Mon, 24 Dec 2012 18:08:53 +0000 (20:08 +0200)
1  2 
Lib/subprocess.py

index 0c60be122dac9c92b1c04b56066656d65cd16c9d,aa3e21754e239e692774504d50fdbf6dbfc7f15d..fd5104891c66e0a129f0f62a95c215dd6027e42d
@@@ -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.
  
                      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