mirror of
https://github.com/python/cpython.git
synced 2025-11-25 12:44:13 +00:00
(Merge 3.4) 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:
commit
35830270e1
1 changed files with 3 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue