Fixed fragile thread-patching code (as redundant as that may sound).
This commit is contained in:
@@ -17,7 +17,7 @@ def _patch_main_thread(mod):
|
||||
# then the main thread will have the wrong key in therading._active,
|
||||
# so, we try and replace that key with the correct one here
|
||||
# this works best if there are no other threads besides the main one
|
||||
curthread = mod._active.pop(mod.current_thread()._Thread__ident, None)
|
||||
curthread = mod._active.pop(mod._get_ident(), None)
|
||||
if curthread:
|
||||
mod._active[thread.get_ident()] = curthread
|
||||
|
||||
|
Reference in New Issue
Block a user