Skip to content

Commit

Permalink
Merge pull request #18 from mherkazandjian/fix_version_string_comparison
Browse files Browse the repository at this point in the history
fix for non-numeric version strings
  • Loading branch information
ipelupessy committed Nov 20, 2015
2 parents c78b185 + 3ec536d commit bdecbc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/amuse/support/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

def compare_version_strings(version1, version2):
def normalize(v):
return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
return [int(x if x.isdigit() else 0) for x in re.sub(r'(\.0+)*$','', v).split(".")]
version1 = normalize(version1)
version2 = normalize(version2)

Expand Down

0 comments on commit bdecbc2

Please sign in to comment.