diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-04 07:57:48 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-04 07:57:48 (GMT) |
commit | 83bdfa08f7747466d0925323a7d94a26470fcd32 (patch) | |
tree | 90cff89d521f9e0b3c9dbc880c6c7c36bf2c7f37 | |
parent | 1703bbbf899da639d75d7300afebb12f5fb2a8c6 (diff) | |
download | cpython-83bdfa08f7747466d0925323a7d94a26470fcd32.zip cpython-83bdfa08f7747466d0925323a7d94a26470fcd32.tar.gz cpython-83bdfa08f7747466d0925323a7d94a26470fcd32.tar.bz2 |
asyncio: Fix _ProactorWritePipeTransport._pipe_closed()
Do nothing if the pipe is already closed. _loop_writing() may call
_force_close() when it gets ConnectionResetError.
-rw-r--r-- | Lib/asyncio/proactor_events.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/asyncio/proactor_events.py b/Lib/asyncio/proactor_events.py index fb67155..6b5707c 100644 --- a/Lib/asyncio/proactor_events.py +++ b/Lib/asyncio/proactor_events.py @@ -304,9 +304,12 @@ class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): if fut.cancelled(): # the transport has been closed return + assert fut.result() == b'' + if self._closing: + assert self._read_fut is None + return assert fut is self._read_fut, (fut, self._read_fut) self._read_fut = None - assert fut.result() == b'' if self._write_fut is not None: self._force_close(exc) else: |