fix version matching. final is assumed and a missing release no longer errors

This commit is contained in:
Kelvin Sherlock 2024-01-12 19:48:36 -05:00
parent 6a8455af50
commit f63135c600
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
#
#
#
rIcon(
color=True,

View File

@ -85,11 +85,11 @@ def _version_to_version(vstr):
stage = 'r'
release = 0
m = re.match(r"([0-9.]+)([dabfr])(\d+)?$", vstr)
m = re.match(r"([0-9.]+)([dabfr])?(\d+)?$", vstr)
if not m: raise ValueError("Bad version string: {}".format(vstr))
stage = m[2]
release = int(m[3], 10)
if m[2]: stage = m[2]
if m[3]: release = int(m[3], 10)
vv = m[1].split('.')
if len(vv) < 1 or len(vv) > 3 or not all(vv):