◐ Shell
clean mode source ↗

[3.9] bpo-40173: Fix test.support.import_helper.import_fresh_module()… by serhiy-storchaka · Pull Request #28658 · python/cpython

…pythonGH-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()..
(cherry picked from commit ec4d917)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>