Eric Snow <ericsnowcurren...@gmail.com> added the comment:
Ah, namespace packages. :) Yeah, the code is not taking the "spec.loader is None" case into account. I expect the fix would be to add handling of that case a few lines up in the code, right after handling BuiltinImporter and FrozenImporter. Offhand I'm not sure if the "type" should be _PKG_DIRECTORY or some new one just for namespace packages. How does imp.find_module() (on which modulefinder._find_module() is based) respond to namespace packages? [1] https://docs.python.org/3/library/importlib.html#importlib.machinery.ModuleSpec.loader ---------- nosy: +barry, brett.cannon, eric.smith, eric.snow _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue40350> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com