[core] Support both dot and dash separators in Version.parse (#14858)

This commit is contained in:
Jonathan Swoboda
2026-03-17 11:45:03 +13:00
committed by Jesse Hills
parent 9133582aa0
commit 0816b27398
+1 -1
View File
@@ -314,7 +314,7 @@ class Version:
@classmethod
def parse(cls, value: str) -> Version:
match = re.match(r"^(\d+).(\d+).(\d+)-?(\w*)$", value)
match = re.match(r"^(\d+).(\d+).(\d+)[-.]?(\w*)$", value)
if match is None:
raise ValueError(f"Not a valid version number {value}")
major = int(match[1])