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 29, 2022
1 parent ef55fd3 commit 92529b5
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 92529b5

Please sign in to comment.