From: Victor Stinner Date: Thu, 15 Jan 2015 12:16:02 +0000 (+0100) Subject: Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess X-Git-Tag: v3.4.3rc1~131 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=791009bb892de2991ea9a66ba1efbdaeb21b268f;p=python Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess transport at subprocess exit. Clear also its reference to the transport. --- diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index a028339c88..c848a21a8f 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/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():