summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorPeter Astrand <astrand@lysator.liu.se>2005-01-01 09:38:57 (GMT)
committerPeter Astrand <astrand@lysator.liu.se>2005-01-01 09:38:57 (GMT)
commitf791d7a278fed1ff3b12bce5c984e4dc907bca62 (patch)
treea8eb61f21fb1c243426438d2566213eb403c8969 /Lib/subprocess.py
parent454f76711c14f0a55119601bfe56a1ab5d2c0e04 (diff)
downloadcpython-f791d7a278fed1ff3b12bce5c984e4dc907bca62.zip
cpython-f791d7a278fed1ff3b12bce5c984e4dc907bca62.tar.gz
cpython-f791d7a278fed1ff3b12bce5c984e4dc907bca62.tar.bz2
On UNIX, when the execution of the child fails, we must waitpid() to
prevent leaving zombies.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index da0c31b..5d0c5e6 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -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