diff options
author | Torsten Marek <shlomme@gmail.com> | 2014-11-16 16:20:56 +0100 |
---|---|---|
committer | Torsten Marek <shlomme@gmail.com> | 2014-11-16 16:20:56 +0100 |
commit | d9e856764f312489964f27f5ddb81e8ce60ec0d0 (patch) | |
tree | 084caf871fc164bcff471c51e9a50413e605c8de /astroid/modutils.py | |
parent | 54643a1f6fc52bc2c36c765343a06be51f57112f (diff) | |
download | astroid-git-d9e856764f312489964f27f5ddb81e8ce60ec0d0.tar.gz |
Recognize modules loaded from $SYS_PREFIX\DLLs as standard library modules on Windows.
Diffstat (limited to 'astroid/modutils.py')
-rw-r--r-- | astroid/modutils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/astroid/modutils.py b/astroid/modutils.py index 528a6e33..23a476f0 100644 --- a/astroid/modutils.py +++ b/astroid/modutils.py @@ -68,6 +68,13 @@ try: STD_LIB_DIRS = [ get_python_lib(standard_lib=True, prefix=sys.prefix), get_python_lib(standard_lib=True)] + if os.name == 'nt': + STD_LIB_DIRS.append(os.path.join(sys.prefix, 'dlls')) + try: + # real_prefix is defined when running inside virtualenv. + STD_LIB_DIRS.append(os.path.join(sys.real_prefix, 'dlls')) + except AttributeError: + pass # 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: |