Skip to content

Commit

Permalink
add type cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintin committed Jan 20, 2017
1 parent 3fdd33a commit 7c88c82
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion andle/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def newer(version1, version2):

def cmp(parts1, parts2):
for i, p in enumerate(parts1):
ret = (p < parts2[i]) - (p > parts2[i])
p = str(p)
s = str(parts2[i])
ret = (p < s) - (p > s)
if ret: return ret
return 0

0 comments on commit 7c88c82

Please sign in to comment.