From cd0d2de6958b2beca43579765692bbbde3220e71 Mon Sep 17 00:00:00 2001 From: memsharded Date: Thu, 26 Oct 2023 00:06:41 +0200 Subject: [PATCH] fix --- conans/model/version_range.py | 2 +- .../unittests/model/version/test_version_range_intersection.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conans/model/version_range.py b/conans/model/version_range.py index 4360758a109..033e1b9691c 100644 --- a/conans/model/version_range.py +++ b/conans/model/version_range.py @@ -51,7 +51,7 @@ def __lt__(self, other): # There's a possibility of getting here while validating if a range is non-void # by comparing >= & <= for lower limit <= upper limit elif other.operator == "<=": - return True + return self.display_version < other.display_version else: return self.display_version.pre is not None return False diff --git a/conans/test/unittests/model/version/test_version_range_intersection.py b/conans/test/unittests/model/version/test_version_range_intersection.py index 8f82e5b91e1..3a8ea0eb855 100644 --- a/conans/test/unittests/model/version/test_version_range_intersection.py +++ b/conans/test/unittests/model/version/test_version_range_intersection.py @@ -18,7 +18,6 @@ # One lower limit, one upper ['>=1.0', "<2.0", ">=1.0 <2.0"], ['>=1', '<=1', ">=1 <=1"], - [">=1", "<=1-", ">=1 <=1-"], [">=1-", "<=1", ">=1- <=1"], # Two lower, one upper ['>=1.0', ">1.0 <2.0", ">1.0 <2.0"], @@ -64,6 +63,7 @@ def test_range_intersection(range1, range2, result): ['>1.0', "<1.0"], ['>=1.0', "<1.0"], ['>1.0', "<=1.0"], + [">=1", "<=1-"], ['>1.0 <2.0', ">2.0"], ['>1.0 <2.0', "<1.0"], ['>1.0 <2.0', ">3.0 <4.0"],