diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2020-05-02 12:21:20 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2020-05-02 12:43:02 +0200 |
commit | 385ce4241921d3f1623771697f67fb589049f5eb (patch) | |
tree | def4bd7acc555d7f53236203866efdb55c9819e8 /pylint/utils/utils.py | |
parent | 1664303adf06ace39225c079e559a26861f954f6 (diff) | |
download | pylint-git-385ce4241921d3f1623771697f67fb589049f5eb.tar.gz |
Allow package files to be properly discovered with multiple jobs
Close #3524
Diffstat (limited to 'pylint/utils/utils.py')
-rw-r--r-- | pylint/utils/utils.py | 9 |
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( { |