Use _typeshed.OptExcInfo in pydoc and unittest (#7668)

This commit is contained in:
Alex Waygood authored and GitHub committed 2022-04-20 21:00:48 +01:00
1 parent b093c90a94
commit a8504f269e
2 files changed
+8 -15

No files matched your search

+2 -6
View File
@@ -1,17 +1,13 @@
from _typeshed import SupportsWrite
from _typeshed import OptExcInfo, SupportsWrite
from abc import abstractmethod
from builtins import list as _list # "list" conflicts with method name
from collections.abc import Callable, Container, Mapping, MutableMapping
from reprlib import Repr
from types import MethodType, ModuleType, TracebackType
from typing import IO, Any, AnyStr, NoReturn, TypeVar
from typing_extensions import TypeAlias
__all__ = ["help"]
# the return type of sys.exc_info(), used by ErrorDuringImport.__init__
_Exc_Info: TypeAlias = tuple[type[BaseException] | None, BaseException | None, TracebackType | None]
_T = TypeVar("_T")
__author__: str
@@ -39,7 +35,7 @@ class ErrorDuringImport(Exception):
exc: type[BaseException] | None
value: BaseException | None
tb: TracebackType | None
def __init__(self, filename: str, exc_info: _Exc_Info) -> None: ...
def __init__(self, filename: str, exc_info: OptExcInfo) -> None: ...
def importfile(path: str) -> ModuleType: ...
def safeimport(path: str, forceload: bool = ..., cache: MutableMapping[str, ModuleType] = ...) -> ModuleType: ...