From: Stefan Krah Date: Sun, 12 Oct 2014 11:29:15 +0000 (+0200) Subject: Issue #19232: Fix sys.modules lookup (--without-threads) X-Git-Tag: v3.5.0a1~683 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bca45ed0c8c25396531ff0645626c9a48801be5a;p=thirdparty%2FPython%2Fcpython.git Issue #19232: Fix sys.modules lookup (--without-threads) --- diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index fef8be6afa13..659e370ca6a6 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -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