Make mypy happy

This commit is contained in:
Kovid Goyal 2025-09-13 07:21:31 +05:30
parent 69ba320db9
commit fe22312602
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -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()