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:
Victor Stinner 2014-06-23 01:02:37 +02:00
parent 62511fd6d6
commit f328c7dc69
6 changed files with 18 additions and 3 deletions

View file

@ -57,11 +57,11 @@ class BaseSelectorEventLoop(base_events.BaseEventLoop):
def close(self):
if self.is_closed():
return
super().close()
self._close_self_pipe()
if self._selector is not None:
self._selector.close()
self._selector = None
super().close()
def _socketpair(self):
raise NotImplementedError