]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
On UNIX, when the execution of the child fails, we must waitpid() to
authorPeter Astrand <astrand@lysator.liu.se>
Sat, 1 Jan 2005 09:32:16 +0000 (09:32 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Sat, 1 Jan 2005 09:32:16 +0000 (09:32 +0000)
prevent leaving zombies.

Lib/subprocess.py

index 9e326fbea42c2e940a349b04eab0cc49feefc5d2..227ee0e998041c6c7273f9e9758591afe3af366b 100644 (file)
@@ -985,6 +985,7 @@ class Popen(object):
             data = os.read(errpipe_read, 1048576) # Exceptions limited to 1 MB
             os.close(errpipe_read)
             if data != "":
+                os.waitpid(self.pid, 0)
                 child_exception = pickle.loads(data)
                 raise child_exception