mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Issue #19232: Fix sys.modules lookup (--without-threads)
This commit is contained in:
parent
e0c988ac7f
commit
bca45ed0c8
1 changed files with 2 additions and 1 deletions
|
@ -144,6 +144,7 @@ __all__ = [
|
||||||
'HAVE_THREADS'
|
'HAVE_THREADS'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
__xname__ = __name__ # sys.modules lookup (--without-threads)
|
||||||
__name__ = 'decimal' # For pickling
|
__name__ = 'decimal' # For pickling
|
||||||
__version__ = '1.70' # Highest version of the spec this complies with
|
__version__ = '1.70' # Highest version of the spec this complies with
|
||||||
# See http://speleotrove.com/decimal/
|
# See http://speleotrove.com/decimal/
|
||||||
|
@ -441,7 +442,7 @@ except ImportError:
|
||||||
# Python was compiled without threads; create a mock object instead
|
# Python was compiled without threads; create a mock object instead
|
||||||
class MockThreading(object):
|
class MockThreading(object):
|
||||||
def local(self, sys=sys):
|
def local(self, sys=sys):
|
||||||
return sys.modules[__name__]
|
return sys.modules[__xname__]
|
||||||
threading = MockThreading()
|
threading = MockThreading()
|
||||||
del MockThreading
|
del MockThreading
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue