Commit ffe637b2 authored by Denis Bilenko's avatar Denis Bilenko

monkey: warn if threading is already imported

parent 97f05b3f
......@@ -2,6 +2,8 @@
import sys
noisy = True
def patch_os():
from gevent.hub import fork
import os
......@@ -13,6 +15,8 @@ def patch_time():
_time.sleep = sleep
def patch_thread():
if noisy and 'threading' in sys.modules:
sys.stderr.write("gevent.monkey's warning: 'threading' is already imported\n\n")
from gevent import thread as green_thread
thread = __import__('thread')
thread.get_ident = green_thread.get_ident
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment