diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-12-27 00:27:09 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-12-27 00:27:09 +0100 |
commit | c5e4fc964d2f2b04106a27f6aa8ab59dc00f7a4b (patch) | |
tree | 73745bd84109b43bb8d9e3f5e943e498242b58c2 | |
parent | bfcd755c451cbdb1ae2b49955d06afc273ede521 (diff) | |
download | aioeventlet-c5e4fc964d2f2b04106a27f6aa8ab59dc00f7a4b.tar.gz |
Support Trollius 1.0.5 with monkey-patching
Restore the original threading module in asyncio.base_events namespace.
-rw-r--r-- | aioeventlet.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/aioeventlet.py b/aioeventlet.py index 1942f69..9acba3d 100644 --- a/aioeventlet.py +++ b/aioeventlet.py @@ -28,6 +28,12 @@ if eventlet.patcher.is_monkey_patched('socket'): # Examples: socket.socket(), socket.socketpair(), # threading.current_thread(). asyncio.base_events.socket = socket + asyncio.base_events.threading = threading + if hasattr(threading, 'get_ident'): + asyncio.base_events._get_thread_ident = threading.get_ident + else: + # Python 2 + asyncio.base_events._get_thread_ident = threading._get_ident asyncio.events.threading = threading if sys.platform == 'win32': asyncio.windows_events.socket = socket |