From eb05a45d7e4d778bdf4f3f6e45e6a3ec4411ef0b Mon Sep 17 00:00:00 2001 From: Claudiu Popa Date: Tue, 15 Dec 2015 21:41:30 +0200 Subject: 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. --- astroid/modutils.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'astroid/modutils.py') 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() -- cgit v1.2.1