From 8fe893f4053d67c20ce1d7be4e8edb31b00c1b18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuomas=20R=C3=A4s=C3=A4nen?= Date: Thu, 26 Mar 2026 20:53:21 +0200 Subject: [PATCH] abitti2.client: fix get_current_abitti2_version() for Abitti2 1.26.0 --- ktp_controller/abitti2/client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ktp_controller/abitti2/client.py b/ktp_controller/abitti2/client.py index 5f4cec7..cc02e44 100644 --- a/ktp_controller/abitti2/client.py +++ b/ktp_controller/abitti2/client.py @@ -105,7 +105,14 @@ def get_abitti2_websock_url(): def get_current_abitti2_version() -> str: - version = _get("/api/version").json()["version"] + try: + # Pre Abitti2 1.26.0 + version = _get("/api/version", timeout=5).json()["version"] + except requests.exceptions.HTTPError as http_error: + if http_error.response.status_code != 404: + raise + # Abitti2 1.26.0+ + version = _get("/api/server-info", timeout=5).json()["version"] version_match = re.match(r"^SERVER-v((\d+)\.(\d+)\.(\d+))$", version) if not version_match: raise RuntimeError("Abitti2 reported version in unexpected format", version)