diff options
Diffstat (limited to 'Lib/asyncio')
| -rw-r--r-- | Lib/asyncio/sslproto.py | 1 | ||||
| -rw-r--r-- | Lib/asyncio/subprocess.py | 5 | ||||
| -rw-r--r-- | Lib/asyncio/unix_events.py | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py index c7fb4e7..117dc56 100644 --- a/Lib/asyncio/sslproto.py +++ b/Lib/asyncio/sslproto.py @@ -417,6 +417,7 @@ class SSLProtocol(protocols.Protocol): self._session_established = False self._in_handshake = False self._in_shutdown = False + self._transport = None def connection_made(self, transport): """Called when the low-level connection is made. 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(): diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index 14b4843..9f4005c 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -516,7 +516,7 @@ class _UnixWritePipeTransport(transports._FlowControlMixin, self._loop.call_soon(self._call_connection_lost, None) def close(self): - if not self._closing: + if self._pipe is not None and not self._closing: # write_eof is all what we needed to close the write pipe self.write_eof() |
