@@ -361,15 +361,15 @@ def find_modules_recursive(self, module: str) -> List[BuildSource]:
361
361
module_path = self .find_module (module )
362
362
if isinstance (module_path , ModuleNotFoundReason ):
363
363
return []
364
- result = [BuildSource (module_path , module , None )]
364
+ sources = [BuildSource (module_path , module , None )]
365
365
366
366
package_path = None
367
367
if module_path .endswith (('__init__.py' , '__init__.pyi' )):
368
368
package_path = os .path .dirname (module_path )
369
369
elif self .fscache .isdir (module_path ):
370
370
package_path = module_path
371
371
if package_path is None :
372
- return result
372
+ return sources
373
373
374
374
# This logic closely mirrors that in find_sources. One small but important difference is
375
375
# that we do not sort names with keyfunc. The recursive call to find_modules_recursive
@@ -382,16 +382,16 @@ def find_modules_recursive(self, module: str) -> List[BuildSource]:
382
382
# Skip certain names altogether
383
383
if name == '__pycache__' or name .startswith ('.' ) or name .endswith ('~' ):
384
384
continue
385
- path = os .path .join (package_path , name )
385
+ subpath = os .path .join (package_path , name )
386
386
387
- if self .fscache .isdir (path ):
387
+ if self .fscache .isdir (subpath ):
388
388
# Only recurse into packages
389
389
if (self .options and self .options .namespace_packages ) or (
390
- self .fscache .isfile (os .path .join (path , "__init__.py" ))
391
- or self .fscache .isfile (os .path .join (path , "__init__.pyi" ))
390
+ self .fscache .isfile (os .path .join (subpath , "__init__.py" ))
391
+ or self .fscache .isfile (os .path .join (subpath , "__init__.pyi" ))
392
392
):
393
393
seen .add (name )
394
- result .extend (self .find_modules_recursive (module + '.' + name ))
394
+ sources .extend (self .find_modules_recursive (module + '.' + name ))
395
395
else :
396
396
stem , suffix = os .path .splitext (name )
397
397
if stem == '__init__' :
@@ -400,8 +400,8 @@ def find_modules_recursive(self, module: str) -> List[BuildSource]:
400
400
# (If we sorted names) we could probably just make the BuildSource ourselves,
401
401
# but this ensures compatibility with find_module / the cache
402
402
seen .add (stem )
403
- result .extend (self .find_modules_recursive (module + '.' + stem ))
404
- return result
403
+ sources .extend (self .find_modules_recursive (module + '.' + stem ))
404
+ return sources
405
405
406
406
407
407
def verify_module (fscache : FileSystemCache , id : str , path : str , prefix : str ) -> bool :
0 commit comments