From e6202d87c3c23643e1993dd62857cea32be5e43d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 2 Jul 2026 14:35:54 +0530 Subject: [PATCH] Remove glsl file is fixing it fails --- kitty/shaders/slang.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kitty/shaders/slang.py b/kitty/shaders/slang.py index 78404546d..c6ae91a5a 100644 --- a/kitty/shaders/slang.py +++ b/kitty/shaders/slang.py @@ -441,11 +441,15 @@ def fixup_opengl_code(glsl_code: str, path: str) -> tuple[str, dict[str, Any]]: def fixup_opengl_files(*paths: str) -> None: - ' Convert the GLSL output of slangc to something that will work with OpenGL 3.3 ' + ' Convert the GLSL output of slangc to something that will work with OpenGL 3.1 ' for path in paths: with open(path, 'r+') as f: glsl_code = f.read() - fixed, metadata = fixup_opengl_code(glsl_code, path) + try: + fixed, metadata = fixup_opengl_code(glsl_code, path) + except Exception: + os.unlink(path) + raise f.seek(0) f.truncate() f.write(fixed)