Skip to content

Commit 23b73aa

Browse files
committed
Fix mypy errors
1 parent 2c24223 commit 23b73aa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg_resources/__init__.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -708,11 +708,15 @@ def find(self, req: Requirement) -> Distribution | None:
708708
If there is no active distribution for the requested project, ``None``
709709
is returned.
710710
"""
711-
for candidate in (
711+
dist: Distribution | None = None
712+
713+
candidates = (
712714
req.key,
713715
self.normalized_to_canonical_keys.get(req.key),
714716
safe_name(req.key).replace(".", "-"),
715-
):
717+
)
718+
719+
for candidate in filter(None, candidates):
716720
dist = self.by_key.get(candidate)
717721
if dist:
718722
req.key = candidate

0 commit comments

Comments
 (0)