Created
June 15, 2016 02:24
-
-
Save nakamuray/f09dcc0ae9039118f5a11fb16a93f066 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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