Last active
June 4, 2019 17:04
-
-
Save 4383/1ac3a2c2cbd6d7a54046d4585ecef151 to your computer and use it in GitHub Desktop.
always use pthread on monkey patched environment
This file contains 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 eventlet | |
eventlet.monkey_patch() | |
if eventlet.patcher.is_monkey_patched("thread"): | |
print("Patched") | |
threading = eventlet.patcher.original("threading") | |
else: | |
print("Not Patched") | |
import threading | |
print(threading.current_thread.__module__) | |
# Will print 'threading' | |
assert threading.current_thread.__module__ == 'threading' | |
# No error will raised |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment