Skip to content

Commit 9eb89de

Browse files
committed
Resolve a version from an item, addressing missed arg-type check.
1 parent 930ebe5 commit 9eb89de

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pkg_resources/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,13 +3465,15 @@ def __contains__(
34653465
if item.key != self.key:
34663466
return False
34673467

3468-
item = item.version
3468+
version = item.version
3469+
else:
3470+
version = item
34693471

34703472
# Allow prereleases always in order to match the previous behavior of
34713473
# this method. In the future this should be smarter and follow PEP 440
34723474
# more accurately.
34733475
return self.specifier.contains(
3474-
item, # type: ignore[arg-type]
3476+
version,
34753477
prereleases=True,
34763478
)
34773479

0 commit comments

Comments
 (0)