checkupdates: split out vercode parsing into testable function

This commit is contained in:
Hans-Christoph Steiner 2019-12-03 23:51:48 +01:00
parent bbee2cf707
commit 7d40e89341
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA
3 changed files with 18 additions and 9 deletions

View file

@ -3224,6 +3224,14 @@ def string_is_integer(string):
return False
def version_code_string_to_int(vercode):
"""Convert an version code string of any base into an int"""
try:
return int(vercode, 0)
except ValueError:
return int(vercode)
def local_rsync(options, fromdir, todir):
'''Rsync method for local to local copying of things