]> granicus.if.org Git - python/commitdiff
Issue #19232: Fix sys.modules lookup (--without-threads)
authorStefan Krah <skrah@bytereef.org>
Sun, 12 Oct 2014 11:29:15 +0000 (13:29 +0200)
committerStefan Krah <skrah@bytereef.org>
Sun, 12 Oct 2014 11:29:15 +0000 (13:29 +0200)
Lib/_pydecimal.py

index fef8be6afa1341946a99768fec088e345c8dcb7d..659e370ca6a6b536db832c11e51fbe375405c1a9 100644 (file)
@@ -144,6 +144,7 @@ __all__ = [
     'HAVE_THREADS'
 ]
 
+__xname__ = __name__    # sys.modules lookup (--without-threads)
 __name__ = 'decimal'    # For pickling
 __version__ = '1.70'    # Highest version of the spec this complies with
                         # See http://speleotrove.com/decimal/
@@ -441,7 +442,7 @@ except ImportError:
     # Python was compiled without threads; create a mock object instead
     class MockThreading(object):
         def local(self, sys=sys):
-            return sys.modules[__name__]
+            return sys.modules[__xname__]
     threading = MockThreading()
     del MockThreading