mirror of
https://github.com/python/cpython.git
synced 2025-08-20 00:32:12 +00:00
Backport r62724 from trunk. Fixes issue 2791. subprocess.Popen.communicate
now closes its stdout and stderr fds as soon as it is finished with them.
This commit is contained in:
parent
1a34834e09
commit
26660401c0
3 changed files with 22 additions and 0 deletions
|
@ -660,8 +660,10 @@ class Popen(object):
|
|||
self.stdin.close()
|
||||
elif self.stdout:
|
||||
stdout = self.stdout.read()
|
||||
self.stdout.close()
|
||||
elif self.stderr:
|
||||
stderr = self.stderr.read()
|
||||
self.stderr.close()
|
||||
self.wait()
|
||||
return (stdout, stderr)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue