Skip to content

Commit

Permalink
Move check on specifier up
Browse files Browse the repository at this point in the history
As we baseline return if link is None, the check against the specifier should be moved up.
  • Loading branch information
fmssn authored Sep 28, 2023
1 parent 2c498f7 commit 85c1ba5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pipenv/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -769,9 +769,13 @@ def is_satisfied(self, req: InstallRequirement):
None,
)
if match is not None:
if req.specifier is not None:
return SpecifierSet(str(req.specifier)).contains(
match.version, prereleases=True
)
if req.link is None:
return True
if req.editable and req.link.is_file:
elif req.editable and req.link.is_file:
requested_path = req.link.file_path
if os.path.exists(requested_path):
local_path = requested_path
Expand All @@ -798,10 +802,6 @@ def is_satisfied(self, req: InstallRequirement):
)
elif req.link.is_vcs:
return False
elif req.specifier is not None:
return SpecifierSet(str(req.specifier)).contains(
match.version, prereleases=True
)
return True
return False

Expand Down

0 comments on commit 85c1ba5

Please sign in to comment.