Index: subprocess.py =================================================================== --- subprocess.py (revisión: 69009) +++ subprocess.py (copia de trabajo) @@ -894,7 +894,10 @@ errwrite.Close() - def _internal_poll(self, _deadstate=None): + # this may be called from __del__, keep a reference to all used names + def _internal_poll(self, _deadstate=None, + WaitForSingleObject=WaitForSingleObject, + GetExitCodeProcess=GetExitCodeProcess): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode is None: @@ -1154,7 +1157,8 @@ raise child_exception - def _handle_exitstatus(self, sts): + # this may be called from __del__, keep a reference to all used names + def _handle_exitstatus(self, sts, os=os): if os.WIFSIGNALED(sts): self.returncode = -os.WTERMSIG(sts) elif os.WIFEXITED(sts): @@ -1164,7 +1168,8 @@ raise RuntimeError("Unknown child exit status!") - def _internal_poll(self, _deadstate=None): + # this may be called from __del__, keep a reference to all used names + def _internal_poll(self, _deadstate=None, os=os): """Check if child process has terminated. Returns returncode attribute.""" if self.returncode is None: