Commit 5e63120f authored by Victor Stinner's avatar Victor Stinner

asyncio: BaseSelectorEventLoop.close() now closes the self-pipe before calling

the parent close() method. If the event loop is already closed, the self-pipe
is not unregistered from the selector.
parent 2d99d93d
......@@ -68,10 +68,12 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
address, waiter, extra)
def close(self):
if self._running:
raise RuntimeError("Cannot close a running event loop")
if self.is_closed():
return
super().close()
self._close_self_pipe()
super().close()
if self._selector is not None:
self._selector.close()
self._selector = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment