@@ -104,12 +104,12 @@ def _basename_in_blacklist_re(base_name, black_list_re):
104104 return False
105105
106106
107- def _modpath_from_file (filename , is_namespace ):
107+ def _modpath_from_file (filename , is_namespace , path = None ):
108108 def _is_package_cb (path , parts ):
109109 return modutils .check_modpath_has_init (path , parts ) or is_namespace
110110
111111 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
113113 )
114114
115115
@@ -200,7 +200,6 @@ def expand_modules(files_or_modules, black_list, black_list_re):
200200 not (modname .endswith (".__init__" ) or modname == "__init__" )
201201 and os .path .basename (filepath ) == "__init__.py"
202202 )
203-
204203 if has_init or is_namespace or is_directory :
205204 for subfilepath in modutils .get_module_files (
206205 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):
212211 ):
213212 continue
214213
215- modpath = _modpath_from_file (subfilepath , is_namespace )
214+ modpath = _modpath_from_file (
215+ subfilepath , is_namespace , path = additional_search_path
216+ )
216217 submodname = "." .join (modpath )
217218 result .append (
218219 {
0 commit comments