Only return packages once.

This commit is contained in:
Jelmer Vernooij 2021-03-23 21:44:49 +00:00
parent 7547b28dfd
commit c52ddccd17

View file

@ -270,7 +270,9 @@ def get_packages_for_paths(
candidates: List[str] = list() candidates: List[str] = list()
for path in paths: for path in paths:
for searcher in searchers: for searcher in searchers:
candidates.extend(searcher.search_files(path, regex=regex)) for pkg in searcher.search_files(path, regex=regex):
if pkg not in candidates:
candidates.append(pkg)
return candidates return candidates