New submission from Benjamin Mintz <benjabe...@gmail.com>:
unzip the attached zip file and run main.py expected output: True <module 'testext.sub' (namespace)> actual output: False <module 'testext.sub' (namespace)> So what? If you follow these directions, https://docs.python.org/3.7/library/importlib.html#checking-if-a-module-can-be-imported , you will put a stale reference in sys.modules even though a fresh reference is already there. If you use that code on a package with a subpackage, the subpackage will not be set as an attribute on the package. ---------- components: Library (Lib) files: importsfucked.zip messages: 347482 nosy: bmintz priority: normal severity: normal status: open title: importlib.util.module_from_spec return value is not the same as in sys.modules versions: Python 3.7 Added file: https://bugs.python.org/file48460/importsfucked.zip _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37521> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com