Issue #23243: Fix asyncio._UnixWritePipeTransport.close()

Do nothing if the transport is already closed. Before it was not possible to
close the transport twice.
This commit is contained in:
Victor Stinner 2015-01-15 13:16:50 +01:00
parent 7e222f411c
commit 41ed958ee6
2 changed files with 4 additions and 1 deletions

View file

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