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:42:28 +0200 |
commit | 54ce3bae10ce545a9f98272bba45e122e7ebaffa (patch) | |
tree | 5d716a4902a9667a6dddd02aed6c725724d68848 /pylint/utils/utils.py | |
parent | 56495fdf6656ce5824f235a30294c1a76d10dcb5 (diff) | |
download | pylint-git-54ce3bae10ce545a9f98272bba45e122e7ebaffa.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( { |