[issue40249] __import__ doesn't honour globals

Serhiy Storchaka report at bugs.python.org
Fri Apr 10 18:50:25 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

globals is only used when level > 0, to resolve relative names like in `import ..foo`. You have to set keys __package__ and __spec__ or __name__ and __path__ in this case.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40249>
_______________________________________


More information about the Python-bugs-list mailing list