mirror of
https://github.com/python/cpython.git
synced 2025-07-30 14:44:10 +00:00
#5179: don't leak PIPE fds when child execution fails.
This commit is contained in:
parent
95777bb019
commit
f3715d2fc7
2 changed files with 19 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue