Make mypy + python 3.14 happy

This commit is contained in:
Kovid Goyal 2026-01-14 22:04:34 +05:30
parent 11775eb12b
commit 2d32c1175c
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -6,6 +6,7 @@
import os
import sys
from collections.abc import Callable, Sequence
from concurrent.futures import ProcessPoolExecutor
from multiprocessing import context, get_all_start_methods, get_context, spawn, util
@ -17,11 +18,14 @@
orig_executable = spawn.get_executable()
if TYPE_CHECKING:
from collections.abc import Buffer
from typing import SupportsIndex, SupportsInt
from _typeshed import ReadableBuffer, SupportsTrunc
ArgsType = Sequence[Union[str, ReadableBuffer, SupportsInt, SupportsIndex, SupportsTrunc]]
if sys.version_info[:2] >= (3, 14):
ArgsType = Sequence[Union[str, Buffer, SupportsInt, SupportsIndex]]
else:
from _typeshed import ReadableBuffer, SupportsTrunc
ArgsType = Sequence[Union[str, ReadableBuffer, SupportsInt, SupportsIndex, SupportsTrunc]]
else:
ArgsType = Sequence[str]