mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Use _typeshed.OptExcInfo in pydoc and unittest (#7668)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user