Skip to content

Instantly share code, notes, and snippets.

@nakamuray
Created June 15, 2016 02:24
Show Gist options
  • Save nakamuray/f09dcc0ae9039118f5a11fb16a93f066 to your computer and use it in GitHub Desktop.
Save nakamuray/f09dcc0ae9039118f5a11fb16a93f066 to your computer and use it in GitHub Desktop.
import asyncio
import threading
def unset_event_loop_policy_forever():
while True:
asyncio.set_event_loop_policy(None)
t = threading.Thread(target=unset_event_loop_policy_forever)
t.daemon = True
t.start()
while True:
# assert asyncio.get_event_loop_policy() is not None
asyncio.get_event_loop()
# -> AttributeError: 'NoneType' object has no attribute 'get_event_loop'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment