mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Add _typeshed.(Opt)ExcInfo (#7645)
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
import sys
|
||||
from _typeshed import structseq
|
||||
from _typeshed import OptExcInfo, structseq
|
||||
from builtins import object as _object
|
||||
from importlib.abc import PathEntryFinder
|
||||
from importlib.machinery import ModuleSpec
|
||||
from io import TextIOWrapper
|
||||
from types import FrameType, ModuleType, TracebackType
|
||||
from typing import Any, AsyncGenerator, Callable, Coroutine, NoReturn, Protocol, Sequence, TextIO, TypeVar, Union, overload
|
||||
from typing import Any, AsyncGenerator, Callable, Coroutine, NoReturn, Protocol, Sequence, TextIO, TypeVar, overload
|
||||
from typing_extensions import Literal, TypeAlias, final
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# The following type alias are stub-only and do not exist during runtime
|
||||
_ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
|
||||
_OptExcInfo: TypeAlias = Union[_ExcInfo, tuple[None, None, None]]
|
||||
_OptExcInfo: TypeAlias = OptExcInfo # TODO: obsolete, remove fall 2022 or later
|
||||
|
||||
# Intentionally omits one deprecated and one optional method of `importlib.abc.MetaPathFinder`
|
||||
class _MetaPathFinder(Protocol):
|
||||
@@ -217,7 +215,7 @@ def _getframe(__depth: int = ...) -> FrameType: ...
|
||||
def _debugmallocstats() -> None: ...
|
||||
def __displayhook__(__value: object) -> None: ...
|
||||
def __excepthook__(__exctype: type[BaseException], __value: BaseException, __traceback: TracebackType | None) -> None: ...
|
||||
def exc_info() -> _OptExcInfo: ...
|
||||
def exc_info() -> OptExcInfo: ...
|
||||
|
||||
# sys.exit() accepts an optional argument of anything printable
|
||||
def exit(__status: object = ...) -> NoReturn: ...
|
||||
|
||||
Reference in New Issue
Block a user