1
0
Fork 0

use lstrip and rstrip instead of strip to fix some edge case

This commit is contained in:
Kayou 2024-03-05 22:25:57 +01:00 committed by GitHub
parent 52dff4d1d0
commit 2353e4ccc1

View file

@ -300,7 +300,7 @@ class AppAutoUpdater:
@staticmethod @staticmethod
def tag_to_int_tuple(tag: str) -> tuple[int, ...]: def tag_to_int_tuple(tag: str) -> tuple[int, ...]:
tag = tag.strip("v").replace("-", ".").strip(".") tag = tag.lstrip("v").replace("-", ".").rstrip(".")
int_tuple = tag.split(".") int_tuple = tag.split(".")
assert all(i.isdigit() for i in int_tuple), f"Cant convert {tag} to int tuple :/" assert all(i.isdigit() for i in int_tuple), f"Cant convert {tag} to int tuple :/"
return tuple(int(i) for i in int_tuple) return tuple(int(i) for i in int_tuple)