diff --git a/importlib_metadata/__init__.py b/importlib_metadata/__init__.py index cb20875b..10e57c96 100644 --- a/importlib_metadata/__init__.py +++ b/importlib_metadata/__init__.py @@ -565,8 +565,9 @@ def find_distributions(self, context=DistributionFinder.Context()): @classmethod def _search_paths(cls, name, paths): """Find metadata directories in paths heuristically.""" + prepared = Prepared(name) return itertools.chain.from_iterable( - path.search(Prepared(name)) for path in map(FastPath, paths) + path.search(prepared) for path in map(FastPath, paths) )