Skip to content

Commit 5a32eda

Browse files
committed
Fix the edge case resulting in incorrect contains resolution
- Pairwise constraint evaluation misses the case when filtered constraints contains only one item - Fixes #137 Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent d2904b0 commit 5a32eda

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/univers/version_constraint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ def contains_version(version, constraints):
506506
if not constraints:
507507
return False
508508

509+
# If we end up with constraints list contains only one item.
510+
if len(constraints) == 1:
511+
return version in constraints[0]
512+
509513
# Iterate over the current and next contiguous constraints pairs (aka. pairwise)
510514
# in the second list.
511515
# For each current and next constraint:

0 commit comments

Comments
 (0)