From 22dd8ecb62169f713048431ba5663ac16562af7b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 26 Jul 2023 02:14:50 +0530 Subject: [PATCH] Apparently people out there want to build kitty with rc Go versions Fixes #6499 --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e6caa2c74..202922c8d 100755 --- a/setup.py +++ b/setup.py @@ -956,7 +956,11 @@ def update_go_generated_files(args: Options, kitty_exe: str) -> None: def parse_go_version(x: str) -> Tuple[int, int, int]: - ans = list(map(int, x.split('.'))) + def safe_int(x: str) -> int: + with suppress(ValueError): + return int(x) + return int(re.split(r'[a-zA-Z]', x)[0]) + ans = list(map(safe_int, x.split('.'))) while len(ans) < 3: ans.append(0) return ans[0], ans[1], ans[2]