mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
asyncio, Tulip issue 171: BaseEventLoop.close() now raises an exception if the
event loop is running. You must first stop the event loop and then wait until it stopped, before closing it.
This commit is contained in:
parent
62511fd6d6
commit
f328c7dc69
6 changed files with 18 additions and 3 deletions
|
@ -355,12 +355,12 @@ class BaseProactorEventLoop(base_events.BaseEventLoop):
|
|||
def close(self):
|
||||
if self.is_closed():
|
||||
return
|
||||
super().close()
|
||||
self._stop_accept_futures()
|
||||
self._close_self_pipe()
|
||||
self._proactor.close()
|
||||
self._proactor = None
|
||||
self._selector = None
|
||||
super().close()
|
||||
|
||||
def sock_recv(self, sock, n):
|
||||
return self._proactor.recv(sock, n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue