Skip to content

Commit

Permalink
Add a comment about missing __spec__ on PyPy (#1758)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielNoord authored and Pierre-Sassoulas committed Aug 28, 2022
1 parent 5b54787 commit 3d102ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions astroid/interpreter/_import/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def is_namespace(modname: str) -> bool:
return False
try:
# .pth files will be on sys.modules
# __spec__ is set inconsistently on PyPy so we can't really on the heuristic here
# See: https://foss.heptapod.net/pypy/pypy/-/issues/3736
return sys.modules[modname].__spec__ is None and not IS_PYPY
except KeyError:
return False
Expand Down

0 comments on commit 3d102ff

Please sign in to comment.