mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
2d99d93d11
commit
5e63120f8d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue