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

fix integer version comparison #6

Merged
merged 1 commit into from
Jan 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix integer version comparison
  • Loading branch information
kendrewlau committed Jan 20, 2017
commit 94b7d164cf521e13fc2c7d898b5ca441660fb21d
3 changes: 3 additions & 0 deletions andle/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ def cmp(parts1, parts2):
for i, p in enumerate(parts1):
p = str(p)
s = str(parts2[i])
if p.isdigit() and s.isdigit():
p = int(p)
s = int(s)
ret = (p < s) - (p > s)
if ret: return ret
return 0