Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a comment about missing __spec__ on PyPy #1758

Merged
merged 1 commit into from
Aug 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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