@@ -5,7 +5,7 @@ from builtins import list as _list # "list" conflicts with method name
55from collections .abc import Callable , Container , Mapping , MutableMapping
66from reprlib import Repr
77from types import MethodType , ModuleType , TracebackType
8- from typing import IO , Any , AnyStr , Final , NoReturn , Protocol , TypeVar , type_check_only
8+ from typing import IO , Any , AnyStr , Final , NoReturn , Protocol , TypeVar , overload , type_check_only
99from typing_extensions import TypeGuard , deprecated
1010
1111__all__ = ["help" ]
@@ -48,7 +48,14 @@ class ErrorDuringImport(Exception):
4848 exc : type [BaseException ] | None
4949 value : BaseException | None
5050 tb : TracebackType | None
51- def __init__ (self , filename : str , exc_info : OptExcInfo ) -> None : ...
51+ if sys .version_info >= (3 , 12 ):
52+ @overload
53+ def __init__ (self , filename : str , exc_info : BaseException ) -> None : ...
54+ @overload
55+ @deprecated ("A tuple value for `exc_info` parameter is deprecated since Python 3.12. Use an exception instance." )
56+ def __init__ (self , filename : str , exc_info : OptExcInfo ) -> None : ...
57+ else :
58+ def __init__ (self , filename : str , exc_info : OptExcInfo ) -> None : ...
5259
5360def importfile (path : str ) -> ModuleType : ...
5461def safeimport (path : str , forceload : bool = ..., cache : MutableMapping [str , ModuleType ] = {}) -> ModuleType | None : ...
0 commit comments