From fe2231260242ba022f3bdabfa9eed559f0c1e96a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Sep 2025 07:21:31 +0530 Subject: [PATCH] Make mypy happy --- kitty/shm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kitty/shm.py b/kitty/shm.py index ffb384a23..4957ae4a9 100644 --- a/kitty/shm.py +++ b/kitty/shm.py @@ -11,6 +11,7 @@ import secrets import stat import struct +from typing import Literal, cast from kitty.fast_data_types import SHM_NAME_MAX, shm_open, shm_unlink @@ -106,7 +107,7 @@ def tell(self) -> int: return self.mmap.tell() def seek(self, pos: int, whence: int = os.SEEK_SET) -> None: - self.mmap.seek(pos, whence) + self.mmap.seek(pos, cast(Literal[0, 1, 2, 3, 4], max(0, min(whence, 4)))) def flush(self) -> None: self.mmap.flush()