From 41e9b1794036b34b9b627b673e5fb13f9b4c9304 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Mon, 13 Apr 2026 14:16:57 +0200 Subject: [PATCH] Cleanup --- sbapp/compat.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sbapp/compat.py b/sbapp/compat.py index d9e2252..94864d3 100644 --- a/sbapp/compat.py +++ b/sbapp/compat.py @@ -38,6 +38,11 @@ def python314_kivy_patch(): print("Patching Kivy for Python 3.14 compatibility...") contents = contents.replace(kivy_target_1, kivy_patch_1) if not kivy_patch_1 in contents: fail_patch() - with open(target_path, "wb") as fh: - fh.write(contents.encode("utf-8")) - print("Kivy successfully patched for Python 3.14 compatibility") + try: + with open(target_path, "wb") as fh: + fh.write(contents.encode("utf-8")) + print("Kivy successfully patched for Python 3.14 compatibility") + + except Exception as e: + print(f"Error while patching Kivy: {e}") + fail_patch()