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

@ -535,7 +535,7 @@ class _SelectorTransport(transports._FlowControlMixin,
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: