Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess

transport at subprocess exit.

Clear also its reference to the transport.
This commit is contained in:
Victor Stinner 2015-01-15 13:16:02 +01:00
parent 72bdefb086
commit 791009bb89

View file

@ -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():