Serhiy Storchaka added the comment: This is rather import machinery issue. The simple reproducer:
$ ./python -c "import importlib; importlib.import_module('.bar', 'foo')" Traceback (most recent call last): File "<string>", line 1, in <module> File "/home/serhiy/py/cpython/Lib/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 981, in _gcd_import File "<frozen importlib._bootstrap>", line 931, in _sanity_check SystemError: Parent module 'foo' not loaded, cannot perform relative import SystemError means programming error and shouldn't be triggered by user code. ---------- nosy: +brett.cannon, eric.snow, ncoghlan _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26216> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com