diff options
-rw-r--r-- | lib/bb/tests/utils.py | 4 | ||||
-rw-r--r-- | lib/bb/utils.py | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/bb/tests/utils.py b/lib/bb/tests/utils.py index 2f4ccf3c6..f1cd83a41 100644 --- a/lib/bb/tests/utils.py +++ b/lib/bb/tests/utils.py @@ -42,6 +42,10 @@ class VerCmpString(unittest.TestCase): self.assertTrue(result < 0) result = bb.utils.vercmp_string('1.1', '1.0+1.1-beta1') self.assertTrue(result > 0) + result = bb.utils.vercmp_string('1.', '1.1') + self.assertTrue(result < 0) + result = bb.utils.vercmp_string('1.1', '1.') + self.assertTrue(result > 0) def test_explode_dep_versions(self): correctresult = {"foo" : ["= 1.10"]} diff --git a/lib/bb/utils.py b/lib/bb/utils.py index 9cb702dbb..b652a6838 100644 --- a/lib/bb/utils.py +++ b/lib/bb/utils.py @@ -121,6 +121,10 @@ def vercmp_part(a, b): return -1 elif oa > ob: return 1 + elif ca is None: + return -1 + elif cb is None: + return 1 elif ca < cb: return -1 elif ca > cb: |