summaryrefslogtreecommitdiff
path: root/astroid/modutils.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2015-12-15 21:41:30 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2015-12-29 16:54:12 +0200
commiteb05a45d7e4d778bdf4f3f6e45e6a3ec4411ef0b (patch)
treedec03ed83e33d3307c71cd11121684967aaadb5b /astroid/modutils.py
parent60f4813e1a56294793e14c9de6a375f6d0a7a22e (diff)
downloadastroid-git-eb05a45d7e4d778bdf4f3f6e45e6a3ec4411ef0b.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.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py
index 7f0ff43f..dd512fae 100644
--- a/astroid/modutils.py
+++ b/astroid/modutils.py
@@ -83,6 +83,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()