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

@ -766,6 +766,9 @@ class UnixWritePipeTransportTests(test_utils.TestCase):
tr.close()
tr.write_eof.assert_called_with()
# closing the transport twice must not fail
tr.close()
def test_close_closing(self):
tr = unix_events._UnixWritePipeTransport(
self.loop, self.pipe, self.protocol)