Issue 13668: mute ImportError in del of _threading_local module (original) (raw)

If python was configured without-threads:

% ./python Python 2.7.2+ (2.7:e71e4bd45c89, Dec 28 2011, 21:03:59) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information.

import dummy_threading as _threading a = _threading.local() del a Exception ImportError: ImportError('No module named thread',) in <bound method local.__del__ of <_threading_local.local object at 0xb7681694>> ignored

Patch to mute this Exception: 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):