diff --git a/conans/model/version_range.py b/conans/model/version_range.py index 150ce35fd9f..4360758a109 100644 --- a/conans/model/version_range.py +++ b/conans/model/version_range.py @@ -48,6 +48,10 @@ def __lt__(self, other): else: if other.operator == ">": return True + # 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 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 00c91a2d881..8f82e5b91e1 100644 --- a/conans/test/unittests/model/version/test_version_range_intersection.py +++ b/conans/test/unittests/model/version/test_version_range_intersection.py @@ -17,7 +17,9 @@ ['<=1.0', "<=1.1", "<=1.0"], # 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-"], + [">=1-", "<=1", ">=1- <=1"], # Two lower, one upper ['>=1.0', ">1.0 <2.0", ">1.0 <2.0"], ['>=1.0', ">1.1 <2.0", ">1.1 <2.0"],