summaryrefslogtreecommitdiff
path: root/pylint/utils/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'pylint/utils/utils.py')
-rw-r--r--pylint/utils/utils.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/pylint/utils/utils.py b/pylint/utils/utils.py
index 6febac19a..fd0c49355 100644
--- a/pylint/utils/utils.py
+++ b/pylint/utils/utils.py
@@ -104,12 +104,12 @@ def _basename_in_blacklist_re(base_name, black_list_re):
return False
-def _modpath_from_file(filename, is_namespace):
+def _modpath_from_file(filename, is_namespace, path=None):
def _is_package_cb(path, parts):
return modutils.check_modpath_has_init(path, parts) or is_namespace
return modutils.modpath_from_file_with_callback(
- filename, is_package_cb=_is_package_cb
+ filename, path=path, is_package_cb=_is_package_cb
)
@@ -200,7 +200,6 @@ def expand_modules(files_or_modules, black_list, black_list_re):
not (modname.endswith(".__init__") or modname == "__init__")
and os.path.basename(filepath) == "__init__.py"
)
-
if has_init or is_namespace or is_directory:
for subfilepath in modutils.get_module_files(
os.path.dirname(filepath), black_list, list_all=is_namespace
@@ -212,7 +211,9 @@ def expand_modules(files_or_modules, black_list, black_list_re):
):
continue
- modpath = _modpath_from_file(subfilepath, is_namespace)
+ modpath = _modpath_from_file(
+ subfilepath, is_namespace, path=additional_search_path
+ )
submodname = ".".join(modpath)
result.append(
{