This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Zhiping.Deng
Recipients Zhiping.Deng
Date 2011-12-28.13:18:10
SpamBayes Score 1.3068296e-09
Marked as misclassified No
Message-id <1325078293.01.0.773837635362.issue13668@psf.upfronthosting.co.za>
In-reply-to
Content
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):
-        import threading
+        try:
+            import threading
+        except ImportError:
+            import sys
+            if '_dummy_threading' in sys.modules:
+                return
+            raise
 
         key = object.__getattribute__(self, '_local__key')
History
Date User Action Args
2011-12-28 13:18:13Zhiping.Dengsetrecipients: + Zhiping.Deng
2011-12-28 13:18:13Zhiping.Dengsetmessageid: <1325078293.01.0.773837635362.issue13668@psf.upfronthosting.co.za>
2011-12-28 13:18:12Zhiping.Denglinkissue13668 messages
2011-12-28 13:18:11Zhiping.Dengcreate