mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
[pydoc] Update ErrorDuringImport (#15251)
This commit is contained in:
+9
-2
@@ -5,7 +5,7 @@ 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, Final, NoReturn, Protocol, TypeVar, type_check_only
|
||||
from typing import IO, Any, AnyStr, Final, NoReturn, Protocol, TypeVar, overload, type_check_only
|
||||
from typing_extensions import TypeGuard, deprecated
|
||||
|
||||
__all__ = ["help"]
|
||||
@@ -48,7 +48,14 @@ class ErrorDuringImport(Exception):
|
||||
exc: type[BaseException] | None
|
||||
value: BaseException | None
|
||||
tb: TracebackType | None
|
||||
def __init__(self, filename: str, exc_info: OptExcInfo) -> None: ...
|
||||
if sys.version_info >= (3, 12):
|
||||
@overload
|
||||
def __init__(self, filename: str, exc_info: BaseException) -> None: ...
|
||||
@overload
|
||||
@deprecated("A tuple value for `exc_info` parameter is deprecated since Python 3.12. Use an exception instance.")
|
||||
def __init__(self, filename: str, exc_info: OptExcInfo) -> None: ...
|
||||
else:
|
||||
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 | None: ...
|
||||
|
||||
Reference in New Issue
Block a user