info.append('closing')
info.append('fd=%s' % self._sock_fd)
# test if the transport was closed
- if self._loop is not None:
+ if self._loop is not None and not self._loop.is_closed():
polling = _test_selector_event(self._loop._selector,
self._sock_fd, selectors.EVENT_READ)
if polling:
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')