diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 19:16:57 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 19:16:57 +0200 |
commit | 60a5a783e164d9095bccdbf787c6ff01ca8176e0 (patch) | |
tree | 3939b4afc536b60ffc128eecac67bceb17078e54 /astroid/modutils.py | |
parent | ccb797f42d040d371cce133ab7251721086e7575 (diff) | |
download | astroid-git-60a5a783e164d9095bccdbf787c6ff01ca8176e0.tar.gz |
Improve the detection of lib_pypy, which was faulty.
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r-- | astroid/modutils.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py index 4a749365..14c53b3a 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -79,8 +79,9 @@ try: except AttributeError: pass if platform.python_implementation() == 'PyPy': - _root = os.path.dirname(sys.executable) - STD_LIB_DIRS.add(os.path.join(_root, 'lib_pypy')) + _root = os.path.join(sys.prefix, 'lib_pypy') + STD_LIB_DIRS.add(_root) + del _root # get_python_lib(standard_lib=1) is not available on pypy, set STD_LIB_DIR to # non-valid path, see https://bugs.pypy.org/issue1164 except DistutilsPlatformError: |