summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Astrand <astrand@lysator.liu.se>2005-01-01 09:32:16 (GMT)
committerPeter Astrand <astrand@lysator.liu.se>2005-01-01 09:32:16 (GMT)
commit5e59063ea95c1204dd28a5ee8c45c6bae4e80de0 (patch)
treee18db193d078f0384bee52e5d88b37c1ebb5f1e7
parent1c5ce881f417f73da9b32f10a9bd30e5ffdb9057 (diff)
downloadcpython-5e59063ea95c1204dd28a5ee8c45c6bae4e80de0.zip
cpython-5e59063ea95c1204dd28a5ee8c45c6bae4e80de0.tar.gz
cpython-5e59063ea95c1204dd28a5ee8c45c6bae4e80de0.tar.bz2
On UNIX, when the execution of the child fails, we must waitpid() to
prevent leaving zombies.
-rw-r--r--Lib/subprocess.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 9e326fb..227ee0e 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -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