summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2021-09-30 16:20:39 (GMT)
committerGitHub <noreply@github.com>2021-09-30 16:20:39 (GMT)
commitec4d917a6a68824f1895f75d113add9410283da7 (patch)
tree5e6e616f4be55cfef8928882f50ce37e6709fbb8 /Lib/test/test_decimal.py
parentb07fddd527efe67174ce6b0fdbe8dac390b16e4e (diff)
downloadcpython-ec4d917a6a68824f1895f75d113add9410283da7.zip
cpython-ec4d917a6a68824f1895f75d113add9410283da7.tar.gz
cpython-ec4d917a6a68824f1895f75d113add9410283da7.tar.bz2
bpo-40173: Fix test.support.import_helper.import_fresh_module() (GH-28654)
* Work correctly if an additional fresh module imports other additional fresh module which imports a blocked module. * Raises ImportError if the specified module cannot be imported while all additional fresh modules are successfully imported. * Support blocking packages. * Always restore the import state of fresh and blocked modules and their submodules. * Fix test_decimal and test_xml_etree which depended on an undesired side effect of import_fresh_module().
Diffstat (limited to 'Lib/test/test_decimal.py')
-rw-r--r--Lib/test/test_decimal.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 99263bb..b6173a5 100644
--- a/Lib/test/test_decimal.py
+++ b/Lib/test/test_decimal.py
@@ -62,7 +62,7 @@ if sys.platform == 'darwin':
C = import_fresh_module('decimal', fresh=['_decimal'])
P = import_fresh_module('decimal', blocked=['_decimal'])
-orig_sys_decimal = sys.modules['decimal']
+import decimal as orig_sys_decimal
# fractions module must import the correct decimal module.
cfractions = import_fresh_module('fractions', fresh=['fractions'])