[issue25372] load_module() does not link submodule to parent package

Brett Cannon report at bugs.python.org
Sun Oct 11 10:58:10 EDT 2015


Brett Cannon added the comment:

This is entirely on purpose as you're not meant to call load_module() if you want to import code programmatically; that's what importlib.import_module() is for. The load_module() method -- which is kind of deprecated thanks to exec_module() -- is there purely to initialize the module being imported, with everything else the responsibility of other parts of import. You should only be calling load_module/execx_module tonload a specific set of bytes and to bypass the import machinery entirely, in which case you have to manage any "extras" you want, like setting a submodule on a parent package.

----------
resolution:  -> not a bug
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25372>
_______________________________________


More information about the Python-bugs-list mailing list