summaryrefslogtreecommitdiff
path: root/astroid/interpreter
diff options
context:
space:
mode:
authorDaniƫl van Noord <13665637+DanielNoord@users.noreply.github.com>2022-08-28 19:57:27 +0200
committerGitHub <noreply@github.com>2022-08-28 19:57:27 +0200
commitad80ee22b2b94aed85fae769a1977dcd6970506b (patch)
treeffdd0619ca3bc2643f25332be0a2317e317e0aac /astroid/interpreter
parent4c3bf08947a9fa37e2463628d20c8316dc6dd71b (diff)
downloadastroid-git-ad80ee22b2b94aed85fae769a1977dcd6970506b.tar.gz
Add a comment about missing ``__spec__`` on ``PyPy`` (#1758)
Diffstat (limited to 'astroid/interpreter')
-rw-r--r--astroid/interpreter/_import/util.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/astroid/interpreter/_import/util.py b/astroid/interpreter/_import/util.py
index 3bdf0470..0c29d670 100644
--- a/astroid/interpreter/_import/util.py
+++ b/astroid/interpreter/_import/util.py
@@ -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