summaryrefslogtreecommitdiffstats
path: root/Lib/subprocess.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-02-14 17:01:36 (GMT)
committerGeorg Brandl <georg@python.org>2009-02-14 17:01:36 (GMT)
commitf3715d2fc72e191c58c76e1eba92f6bc0a5a0e9d (patch)
tree50f867a242a1748dac5af195a41c32d2f0e6a612 /Lib/subprocess.py
parent95777bb019b2b42cef8caaf80723f3bb0409970c (diff)
downloadcpython-f3715d2fc72e191c58c76e1eba92f6bc0a5a0e9d.zip
cpython-f3715d2fc72e191c58c76e1eba92f6bc0a5a0e9d.tar.gz
cpython-f3715d2fc72e191c58c76e1eba92f6bc0a5a0e9d.tar.bz2
#5179: don't leak PIPE fds when child execution fails.
Diffstat (limited to 'Lib/subprocess.py')
-rw-r--r--Lib/subprocess.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 309f5d4..d91fbee 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1151,6 +1151,9 @@ class Popen(object):
if data != "":
os.waitpid(self.pid, 0)
child_exception = pickle.loads(data)
+ for fd in (p2cwrite, c2pread, errread):
+ if fd is not None:
+ os.close(fd)
raise child_exception