diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 12:16:02 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-01-15 12:16:02 (GMT) |
commit | 791009bb892de2991ea9a66ba1efbdaeb21b268f (patch) | |
tree | f5096de8cbdcd535535ff98231c93b3a0d4691d1 | |
parent | 72bdefb0868771d360385da55750e8742dab3e05 (diff) | |
download | cpython-791009bb892de2991ea9a66ba1efbdaeb21b268f.zip cpython-791009bb892de2991ea9a66ba1efbdaeb21b268f.tar.gz cpython-791009bb892de2991ea9a66ba1efbdaeb21b268f.tar.bz2 |
Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess
transport at subprocess exit.
Clear also its reference to the transport.
-rw-r--r-- | Lib/asyncio/subprocess.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index a028339..c848a21 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(): |