summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-12-27 00:27:09 +0100
committerVictor Stinner <victor.stinner@gmail.com>2014-12-27 00:27:09 +0100
commitc5e4fc964d2f2b04106a27f6aa8ab59dc00f7a4b (patch)
tree73745bd84109b43bb8d9e3f5e943e498242b58c2
parentbfcd755c451cbdb1ae2b49955d06afc273ede521 (diff)
downloadaioeventlet-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.py6
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