From c5e4fc964d2f2b04106a27f6aa8ab59dc00f7a4b Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sat, 27 Dec 2014 00:27:09 +0100 Subject: Support Trollius 1.0.5 with monkey-patching Restore the original threading module in asyncio.base_events namespace. --- aioeventlet.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- cgit v1.2.1