mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 14:46:03 +00:00
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 os
|
|||
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 @@ class SharedMemory:
|
|||
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…
Add table
Add a link
Reference in a new issue