- Issue #12044: Fixed subprocess.Popen when used as a context manager to

wait for the process to end when exiting the context to avoid unintentionally
  leaving zombie processes around.
This commit is contained in:
Gregory P. Smith 2011-05-11 21:42:08 -07:00
parent 4e19e11958
commit 6b65745430
4 changed files with 10 additions and 3 deletions

View file

@ -796,6 +796,8 @@ class Popen(object):
self.stderr.close()
if self.stdin:
self.stdin.close()
# Wait for the process to terminate, to avoid zombies.
self.wait()
def __del__(self, _maxsize=sys.maxsize, _active=_active):
if not self._child_created: