@@ -104,12 +104,12 @@ def _basename_in_blacklist_re(base_name, black_list_re):
104
104
return False
105
105
106
106
107
- def _modpath_from_file (filename , is_namespace ):
107
+ def _modpath_from_file (filename , is_namespace , path = None ):
108
108
def _is_package_cb (path , parts ):
109
109
return modutils .check_modpath_has_init (path , parts ) or is_namespace
110
110
111
111
return modutils .modpath_from_file_with_callback (
112
- filename , is_package_cb = _is_package_cb
112
+ filename , path = path , is_package_cb = _is_package_cb
113
113
)
114
114
115
115
@@ -200,7 +200,6 @@ def expand_modules(files_or_modules, black_list, black_list_re):
200
200
not (modname .endswith (".__init__" ) or modname == "__init__" )
201
201
and os .path .basename (filepath ) == "__init__.py"
202
202
)
203
-
204
203
if has_init or is_namespace or is_directory :
205
204
for subfilepath in modutils .get_module_files (
206
205
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):
212
211
):
213
212
continue
214
213
215
- modpath = _modpath_from_file (subfilepath , is_namespace )
214
+ modpath = _modpath_from_file (
215
+ subfilepath , is_namespace , path = additional_search_path
216
+ )
216
217
submodname = "." .join (modpath )
217
218
result .append (
218
219
{
0 commit comments