Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bca45ed

Browse files
author
Stefan Krah
committed
Issue #19232: Fix sys.modules lookup (--without-threads)
1 parent e0c988a commit bca45ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/_pydecimal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
'HAVE_THREADS'
145145
]
146146

147+
__xname__ = __name__ # sys.modules lookup (--without-threads)
147148
__name__ = 'decimal' # For pickling
148149
__version__ = '1.70' # Highest version of the spec this complies with
149150
# See http://speleotrove.com/decimal/
@@ -441,7 +442,7 @@ class FloatOperation(DecimalException, TypeError):
441442
# Python was compiled without threads; create a mock object instead
442443
class MockThreading(object):
443444
def local(self, sys=sys):
444-
return sys.modules[__name__]
445+
return sys.modules[__xname__]
445446
threading = MockThreading()
446447
del MockThreading
447448

0 commit comments

Comments
 (0)