asyncio: Fix _SelectorTransport.__repr__() if the event loop is closed

This commit is contained in:
Victor Stinner 2015-03-27 15:20:08 +01:00
parent 0b4e355b8e
commit 79fd962652
2 changed files with 6 additions and 1 deletions

View file

@ -62,6 +62,11 @@ class BaseSelectorEventLoopTests(test_utils.TestCase):
self.loop.add_reader._is_coroutine = False
transport = self.loop._make_socket_transport(m, asyncio.Protocol())
self.assertIsInstance(transport, _SelectorSocketTransport)
# Calling repr() must not fail when the event loop is closed
self.loop.close()
repr(transport)
close_transport(transport)
@unittest.skipIf(ssl is None, 'No ssl module')