We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c24223 commit 23b73aaCopy full SHA for 23b73aa
pkg_resources/__init__.py
@@ -708,11 +708,15 @@ def find(self, req: Requirement) -> Distribution | None:
708
If there is no active distribution for the requested project, ``None``
709
is returned.
710
"""
711
- for candidate in (
+ dist: Distribution | None = None
712
+
713
+ candidates = (
714
req.key,
715
self.normalized_to_canonical_keys.get(req.key),
716
safe_name(req.key).replace(".", "-"),
- ):
717
+ )
718
719
+ for candidate in filter(None, candidates):
720
dist = self.by_key.get(candidate)
721
if dist:
722
req.key = candidate
0 commit comments