Make mypy happy
This commit is contained in:
parent
69ba320db9
commit
fe22312602
1 changed files with 2 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue