diff --git a/stdlib/sys/__init__.pyi b/stdlib/sys/__init__.pyi index 505e38fa5..c4b1adca9 100644 --- a/stdlib/sys/__init__.pyi +++ b/stdlib/sys/__init__.pyi @@ -12,7 +12,6 @@ _T = TypeVar("_T") # see https://github.com/python/typeshed/issues/8513#issue-1333671093 for the rationale behind this alias _ExitCode: TypeAlias = str | int | None -_OptExcInfo: TypeAlias = OptExcInfo # noqa: Y047 # TODO: obsolete, remove fall 2022 or later # ----- sys variables ----- if sys.platform != "win32": diff --git a/stdlib/wsgiref/types.pyi b/stdlib/wsgiref/types.pyi index 86212df8c..57276fd05 100644 --- a/stdlib/wsgiref/types.pyi +++ b/stdlib/wsgiref/types.pyi @@ -1,5 +1,5 @@ +from _typeshed import OptExcInfo from collections.abc import Callable, Iterable, Iterator -from sys import _OptExcInfo from typing import Any, Protocol from typing_extensions import TypeAlias @@ -7,7 +7,7 @@ __all__ = ["StartResponse", "WSGIEnvironment", "WSGIApplication", "InputStream", class StartResponse(Protocol): def __call__( - self, status: str, headers: list[tuple[str, str]], exc_info: _OptExcInfo | None = ..., / + self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., / ) -> Callable[[bytes], object]: ... WSGIEnvironment: TypeAlias = dict[str, Any] diff --git a/stubs/pynput/pynput/_util.pyi b/stubs/pynput/pynput/_util.pyi index 3c2ff8480..9b9affebf 100644 --- a/stubs/pynput/pynput/_util.pyi +++ b/stubs/pynput/pynput/_util.pyi @@ -1,5 +1,5 @@ -import sys import threading +from _typeshed import OptExcInfo from collections.abc import Callable from queue import Queue from types import ModuleType, TracebackType @@ -28,7 +28,7 @@ class AbstractListener(threading.Thread): _thread: threading.Thread # undocumented _condition: threading.Condition # undocumented _ready: bool # undocumented - _queue: Queue[sys._OptExcInfo | None] # undocumented + _queue: Queue[OptExcInfo | None] # undocumented daemon: bool def __init__(self, suppress: bool = False, **kwargs: Callable[..., bool | None] | None) -> None: ... @property