From b7428f65cfb46d48ae46f943f68c635c7f87dbbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Me=C3=9Fmer?= Date: Wed, 14 Sep 2016 14:20:15 +0200 Subject: [PATCH] Use concrete type in sys.excepthook() This is necessary, because exception formatting functions like `traceback.format_exception()` expect to get `Type[BaseException]`, but sys.excepthook only provided `type` --- stdlib/3/sys.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/3/sys.pyi b/stdlib/3/sys.pyi index c3ce9c6e2de4..28b23a546405 100644 --- a/stdlib/3/sys.pyi +++ b/stdlib/3/sys.pyi @@ -115,7 +115,7 @@ def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, Any]: ... def displayhook(value: Optional[int]) -> None: ... -def excepthook(type_: type, value: BaseException, +def excepthook(type_: Type[BaseException], value: BaseException, traceback: TracebackType) -> None: ... # TODO should be a union of tuple, see mypy#1178 def exc_info() -> Tuple[Optional[Type[BaseException]],