From 4c0ead129e234e6dde4c85508f302e0d2c26c209 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Jul 2024 06:23:48 +0530 Subject: [PATCH] Support older python --- kitty/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/utils.py b/kitty/utils.py index f3b25a1a6..dd1694811 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -1229,7 +1229,10 @@ def timed_debug_print(*a: Any, sep: str = ' ', end: str = '\n') -> None: def cached_rgba_file_descriptor_for_image_path(path: str) -> Tuple[int, int, int]: from hashlib import sha256 - path = os.path.realpath(path, strict=True) + try: + path = os.path.realpath(path, strict=True) + except TypeError: + path = os.path.realpath(path) src_info = os.stat(path) output_name = sha256(path.encode()).hexdigest() + '.rgba' output_path = os.path.join(cache_dir(), 'rgba', output_name)