Fixed fragile thread-patching code (as redundant as that may sound).

This commit is contained in:
Ryan Williams
2010-02-19 21:31:40 -08:00
parent 3aac8427cc
commit dcc7b59876

View File

@@ -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