[pydoc] Update ErrorDuringImport (#15251)

This commit is contained in:
Semyon Moroz
2026-01-10 23:22:53 +00:00
committed by GitHub
parent bf0f0a56a8
commit 98d6327550
+9 -2
View File
@@ -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: ...