Commit fa4242cb authored by Anton Patrushev's avatar Anton Patrushev Committed by Denis Bilenko

Fix #6: patch sys after thread

from PR #232
parent 4ece83bc
...@@ -171,14 +171,16 @@ def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=Tru ...@@ -171,14 +171,16 @@ def patch_all(socket=True, dns=True, time=True, select=True, thread=True, os=Tru
subprocess=False, sys=False, aggressive=True, Event=False): subprocess=False, sys=False, aggressive=True, Event=False):
"""Do all of the default monkey patching (calls every other function in this module.""" """Do all of the default monkey patching (calls every other function in this module."""
# order is important # order is important
if sys:
patch_sys()
if os: if os:
patch_os() patch_os()
if time: if time:
patch_time() patch_time()
if thread: if thread:
patch_thread(Event=Event) patch_thread(Event=Event)
# sys must be patched after thread. in other cases threading._shutdown will be
# initiated to _MainThread with real thread ident
if sys:
patch_sys()
if socket: if socket:
patch_socket(dns=dns, aggressive=aggressive) patch_socket(dns=dns, aggressive=aggressive)
if select: if select:
......
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