diff --git a/Lib/_threading_local.py b/Lib/_threading_local.py --- a/Lib/_threading_local.py +++ b/Lib/_threading_local.py @@ -221,7 +221,13 @@ lock.release() def __del__(self): - import threading + try: + import threading + except ImportError: + import sys + if '_dummy_threading' in sys.modules: + return + raise key = object.__getattribute__(self, '_local__key')