Skip to content

Commit

Permalink
fix integer version comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
kendrewlau committed Jan 20, 2017
1 parent 7c88c82 commit 94b7d16
Showing 1 changed file with 3 additions and 0 deletions.
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

0 comments on commit 94b7d16

Please sign in to comment.