Skip to content

Commit

Permalink
Fix the edge case resulting in incorrect contains resolution
Browse files Browse the repository at this point in the history
- Pairwise constraint evaluation misses the case when filtered
 constraints contains only one item
- Fixes #137

Signed-off-by: Keshav Priyadarshi <[email protected]>
  • Loading branch information
keshav-space committed Jul 24, 2024
1 parent d2904b0 commit 5a32eda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/univers/version_constraint.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ def contains_version(version, constraints):
if not constraints:
return False

# If we end up with constraints list contains only one item.
if len(constraints) == 1:
return version in constraints[0]

# Iterate over the current and next contiguous constraints pairs (aka. pairwise)
# in the second list.
# For each current and next constraint:
Expand Down

0 comments on commit 5a32eda

Please sign in to comment.