rm redundant function from util

This commit is contained in:
SomberNight 2018-09-05 18:36:13 +02:00
parent 69a204d726
commit 40ceabff79
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9
2 changed files with 1 additions and 4 deletions

View file

@ -83,7 +83,7 @@ def parse_servers(result):
def filter_version(servers):
def is_recent(version):
try:
return util.normalize_version(version) >= util.normalize_version(PROTOCOL_VERSION)
return util.versiontuple(version) >= util.versiontuple(PROTOCOL_VERSION)
except Exception as e:
return False
return {k: v for k, v in servers.items() if is_recent(v.get('version'))}

View file

@ -71,9 +71,6 @@ def base_unit_name_to_decimal_point(unit_name: str) -> int:
raise UnknownBaseUnit(unit_name) from None
def normalize_version(v):
return [int(x) for x in re.sub(r'(\.0+)*$','', v).split(".")]
class NotEnoughFunds(Exception): pass