diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 21:41:30 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2015-12-15 21:41:30 +0200 |
commit | e305a359a5d6a858a67f6bed14ba3d5fcef6eb40 (patch) | |
tree | 60025fa2b8561c2431b98a4dd719929442c021bd /astroid/modutils.py | |
parent | a71332002adabe8fdb7536c96da00d40b630cdf2 (diff) | |
download | astroid-git-e305a359a5d6a858a67f6bed14ba3d5fcef6eb40.tar.gz |
Add lib_pypy from the real installation of Python
This solves a problem with pypy and virtualenv, the latter deciding
not to copy some of the modules into the virtual environment, such
as datetime, which means that STD_LIB_DIRS needs to be updated in
order to look there as well.
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r-- | astroid/modutils.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py index ec86010d..981b6e90 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -86,6 +86,11 @@ if os.name == 'nt': if platform.python_implementation() == 'PyPy': _root = os.path.join(sys.prefix, 'lib_pypy') STD_LIB_DIRS.add(_root) + try: + # real_prefix is defined when running inside virtualenv. + STD_LIB_DIRS.add(os.path.join(sys.real_prefix, 'lib_pypy')) + except AttributeError: + pass del _root EXT_LIB_DIR = get_python_lib() |