File tree 1 file changed +2
-1
lines changed
astroid/interpreter/_import 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ def _is_old_setuptools_namespace_package(modname: str) -> bool:
31
31
def is_namespace (modname : str ) -> bool :
32
32
"""Determine whether we encounter a namespace package."""
33
33
if PY36 :
34
- # On Pyhton 3.6 an AttributeError is raised when a package
34
+ # On Python 3.6 an AttributeError is raised when a package
35
35
# is lacking a __path__ attribute and thus is not a
36
36
# package.
37
37
try :
@@ -61,6 +61,7 @@ def is_namespace(modname: str) -> bool:
61
61
if not isinstance (spec .loader , abc .InspectLoader ):
62
62
return True
63
63
64
+ # Lastly we check if the package declares itself a namespace package
64
65
source = spec .loader .get_source (spec .origin )
65
66
return bool (
66
67
source and "pkg_resources" in source and "declare_namespace(__name__)" in source
You can’t perform that action at this time.
0 commit comments