File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ def _get_module_path(name: str) -> list[str]:
3434 return module .__path__
3535
3636
37- def _find_library (entrypoint : importlib_metadata .EntryPoint ) -> str :
37+ def _find_library (entrypoint : importlib_metadata .EntryPoint ) -> str | None :
3838 found = []
3939 for path in _get_module_path (entrypoint .value ):
4040 lib = pathlib .Path (path , f'lib{ entrypoint .name } { _EXT } ' )
@@ -46,12 +46,14 @@ def _find_library(entrypoint: importlib_metadata.EntryPoint) -> str:
4646 + ', ' .join (os .path (candidate ) for candidate in found ),
4747 stacklevel = 2 ,
4848 )
49+ return
4950 if len (found ) == 0 :
5051 warnings .warn (f"Didn't find object file for library { entrypoint .name !r} " , stacklevel = 2 )
52+ return
5153 return found [0 ]
5254
5355
5456def get_libraries () -> Sequence [pathlib .Path ]:
5557 entrypoints = importlib_metadata .entry_points (group = 'dynamic_library' )
5658 sorted_entrypoints = sorted (entrypoints , key = operator .attrgetter ('name' ))
57- return list (map (_find_library , sorted_entrypoints ))
59+ return list (filter ( None , map (_find_library , sorted_entrypoints ) ))
You can’t perform that action at this time.
0 commit comments