diff --git a/stdlib/2/sys.pyi b/stdlib/2/sys.pyi index be688f5b4..f8651abdb 100644 --- a/stdlib/2/sys.pyi +++ b/stdlib/2/sys.pyi @@ -89,8 +89,8 @@ last_traceback: TracebackType meta_path: List[Any] path_hooks: List[Any] path_importer_cache: Dict[str, Any] -displayhook: Optional[Callable[[int], None]] -excepthook: Optional[Callable[[type, BaseException, TracebackType], None]] +displayhook: Callable[[object], Any] +excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any] exc_type: Optional[type] exc_value: Union[BaseException, ClassType] exc_traceback: TracebackType @@ -112,7 +112,7 @@ def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, FrameType]: ... def _getframe(depth: int = ...) -> FrameType: ... def call_tracing(fn: Any, args: Any) -> Any: ... -def __displayhook__(value: int) -> None: ... +def __displayhook__(value: object) -> None: ... def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ... def exc_clear() -> None: ... def exc_info() -> _OptExcInfo: ... diff --git a/stdlib/3/sys.pyi b/stdlib/3/sys.pyi index 3d17a55c9..f78826c65 100644 --- a/stdlib/3/sys.pyi +++ b/stdlib/3/sys.pyi @@ -28,8 +28,8 @@ builtin_module_names: Sequence[str] # actually a tuple of strings copyright: str # dllhandle = 0 # Windows only dont_write_bytecode: bool -__displayhook__: Any # contains the original value of displayhook -__excepthook__: Any # contains the original value of excepthook +displayhook: Callable[[object], Any] +excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any] exec_prefix: str executable: str float_repr_style: str @@ -131,9 +131,9 @@ def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, Any]: ... def _debugmallocstats() -> None: ... -def displayhook(value: Optional[int]) -> None: ... -def excepthook(type_: Type[BaseException], value: BaseException, - traceback: TracebackType) -> None: ... +def __displayhook__(value: object) -> None: ... +def __excepthook__(type_: Type[BaseException], value: BaseException, + traceback: TracebackType) -> None: ... def exc_info() -> _OptExcInfo: ... # sys.exit() accepts an optional argument of anything printable def exit(arg: object = ...) -> NoReturn: ...