Skip to content

Instantly share code, notes, and snippets.

@leopard627
Created November 13, 2020 10:13
Show Gist options
  • Save leopard627/000e44682c18145e947100ac2a2f9d62 to your computer and use it in GitHub Desktop.
Save leopard627/000e44682c18145e947100ac2a2f9d62 to your computer and use it in GitHub Desktop.
# asyncio/events.py in get_event_loop at line 602
not self._local._set_called and
isinstance(threading.current_thread(), threading._MainThread)):
self.set_event_loop(self.new_event_loop())
if self._local._loop is None:
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
return self._local._loop
def set_event_loop(self, loop):
"""Set the event loop."""
self._local._set_called = True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment