]> granicus.if.org Git - python/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:38:57 +0000 (09:38 +0000)
committerPeter Astrand <astrand@lysator.liu.se>
Sat, 1 Jan 2005 09:38:57 +0000 (09:38 +0000)
prevent leaving zombies.

Lib/subprocess.py

index da0c31b6c93d9d5248238a4f881645b16c5c5ef6..5d0c5e668e3b3ac57da529ae42b92c78f238c3f2 100644 (file)
@@ -1023,6 +1023,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