summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-15 12:52:05 +0100
committerVictor Stinner <victor.stinner@gmail.com>2015-01-15 12:52:05 +0100
commitc353d7558327de461cdd4a2cc73dbd9d6ad6698a (patch)
tree2ea5c7cd19170da2b9c1aa12ef34c4697015f045
parent2b30a1ae96fbf0209c4ddce8d91437a32ed76e54 (diff)
downloadtrollius-c353d7558327de461cdd4a2cc73dbd9d6ad6698a.tar.gz
Python issue #23242: SubprocessStreamProtocol now closes the subprocess
transport at subprocess exit. Clear also its reference to the transport.
-rw-r--r--asyncio/subprocess.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/asyncio/subprocess.py b/asyncio/subprocess.py
index a028339..c848a21 100644
--- a/asyncio/subprocess.py
+++ b/asyncio/subprocess.py
@@ -94,8 +94,11 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
reader.set_exception(exc)
def process_exited(self):
- # wake up futures waiting for wait()
returncode = self._transport.get_returncode()
+ self._transport.close()
+ self._transport = None
+
+ # wake up futures waiting for wait()
while self._waiters:
waiter = self._waiters.popleft()
if not waiter.cancelled():