diff options
-rw-r--r-- | semantic_version/base.py | 2 | ||||
-rwxr-xr-x | tests/test_base.py | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/semantic_version/base.py b/semantic_version/base.py index 83a9c25..0f4e11b 100644 --- a/semantic_version/base.py +++ b/semantic_version/base.py @@ -470,7 +470,7 @@ class SpecItem(object): elif self.kind == self.KIND_TILDE: return self.spec <= version < self.spec.next_minor() elif self.kind == self.KIND_COMPATIBLE: - if self.spec.patch: + if self.spec.patch is not None: upper = self.spec.next_minor() else: upper = self.spec.next_major() diff --git a/tests/test_base.py b/tests/test_base.py index 0675b24..a1255c3 100755 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -518,6 +518,10 @@ class SpecItemTestCase(unittest.TestCase): ['1.4.5', '1.4.10-alpha', '1.4.10'], ['1.3.6', '1.4.4', '1.5.0'], ), + '~=1.4.0': ( + ['1.4.0', '1.4.10-alpha', '1.4.10'], + ['1.3.6', '1.3.9', '1.5.0'], + ), '~=1.4': ( ['1.4.0', '1.6.10-alpha', '1.6.10'], ['1.3.0', '2.0.0'], |