Skip to content

Commit

Permalink
Merge 9c8e75f into eaef0db
Browse files Browse the repository at this point in the history
  • Loading branch information
markmcclain committed Apr 4, 2019
2 parents eaef0db + 9c8e75f commit 0c2868f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions astroid/modutils.py
Expand Up @@ -106,7 +106,7 @@ def _posix_path(path):
# https://github.com/PyCQA/pylint/issues/712#issuecomment-163178753
STD_LIB_DIRS.add(_posix_path('lib64'))

EXT_LIB_DIR = get_python_lib()
EXT_LIB_DIRS = {get_python_lib(), get_python_lib(True)}
IS_JYTHON = platform.python_implementation() == 'Jython'
BUILTIN_MODULES = dict.fromkeys(sys.builtin_module_names, True)

Expand Down Expand Up @@ -542,8 +542,9 @@ def is_standard_module(modname, std_path=None):
# we assume there are no namespaces in stdlib
return not util.is_namespace(modname)
filename = _normalize_path(filename)
if filename.startswith(_cache_normalize_path(EXT_LIB_DIR)):
return False
for path in EXT_LIB_DIRS:
if filename.startswith(_cache_normalize_path(path)):
return False
if std_path is None:
std_path = STD_LIB_DIRS
for path in std_path:
Expand Down
2 changes: 1 addition & 1 deletion astroid/tests/unittest_modutils.py
Expand Up @@ -200,7 +200,7 @@ def test_4(self):

def test_custom_path(self):
datadir = resources.find('')
if datadir.startswith(modutils.EXT_LIB_DIR):
if any(datadir.startswith(p) for p in modutils.EXT_LIB_DIRS):
self.skipTest('known breakage of is_standard_module on installed package')

self.assertTrue(modutils.is_standard_module('data.module', (datadir,)))
Expand Down

0 comments on commit 0c2868f

Please sign in to comment.