Skip to content

Commit

Permalink
Fixed version comparison using incorrect alphabetic comparison on num…
Browse files Browse the repository at this point in the history
…bers
  • Loading branch information
A.J. Venter authored and A.J. Venter committed Jun 19, 2017
1 parent 6d638aa commit ad4e4f4
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libPyKAN/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __cmp__(self, other):
except IndexError:
j = '0'
if i == j:
print(i,j,'Equal')
continue
if re.findall('pre|alpha|beta',i):
if self.numpart(i) <= self.numpart(j):
Expand All @@ -96,9 +97,17 @@ def __cmp__(self, other):
return 1
else:
return -1
try:
i = int(i)
j = int(j)
except:
pass
if i > j:
print(type(i),type(j))
print(i,j,'I is bigger')
return 1
if i < j:
print(i,j,'I is smaller')
return -1
return 0

Expand Down

0 comments on commit ad4e4f4

Please sign in to comment.