Commit c01eb80d authored by Jason Madden's avatar Jason Madden

Use the return value of the function, don't shortcut through the current...

Use the return value of the function, don't shortcut through the current thread. sometimes under py3 the current thread id isn't set, and the release() methods we're trying to patch around use get_ident() anyway. Fixes #615. Really, not just the test cases.
parent 6bc64ff4
...@@ -150,7 +150,10 @@ def patch_time(): ...@@ -150,7 +150,10 @@ def patch_time():
def _patch_existing_locks(threading): def _patch_existing_locks(threading):
if len(list(threading.enumerate())) != 1: if len(list(threading.enumerate())) != 1:
return return
tid = threading.current_thread().ident try:
tid = threading.get_ident()
except AttributeError:
tid = threading._get_ident()
rlock_type = type(threading.RLock()) rlock_type = type(threading.RLock())
try: try:
import importlib._bootstrap import importlib._bootstrap
......
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