Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when comparing partial and full version #95

Open
Thyrst opened this issue Mar 25, 2020 · 0 comments
Open

TypeError when comparing partial and full version #95

Thyrst opened this issue Mar 25, 2020 · 0 comments

Comments

@Thyrst
Copy link

Thyrst commented Mar 25, 2020

From changelog under the 2.7.0 release:
Backwards compatibility has been kept

However there is a breaking change that prevents me from upgrading to a new version. This example behaves same for both 2.7.0 and the latest 2.8.4 version.

>>> version_1 = Version("8.0", partial=True)
>>> version_2 = Version("8.0.0")
>>> version_1 > version_2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/thyrst/Temp/env/lib/python3.6/site-packages/semantic_version/base.py", line 463, in __gt__
    return self.precedence_key > other.precedence_key
TypeError: '>' not supported between instances of 'NoneType' and 'int'
>>> version_1 >= version_2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/thyrst/Temp/env/lib/python3.6/site-packages/semantic_version/base.py", line 468, in __ge__
    return self.precedence_key >= other.precedence_key
TypeError: '>=' not supported between instances of 'NoneType' and 'int'
>>> version_1 == version_2
False

In the 2.6.0 version:

>>> version_1 = Version("8.0", partial=True)
>>> version_2 = Version("8.0.0")
>>> version_1 > version_2
False
>>> version_1 >= version_2
True
>>> version_1 == version_2
True

There should be a warning about this change in the changelog.

Instead of the TypeError I would expect just False.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant