Skip to content

Commit 96ba625

Browse files
smessmergvanrossum
authored andcommitted
Use concrete type in sys.excepthook() (#547)
This is necessary, because exception formatting functions like `traceback.format_exception()` expect to get `Type[BaseException]`, but sys.excepthook only provided `type`
1 parent e25b882 commit 96ba625

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/3/sys.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ...
115115
def _clear_type_cache() -> None: ...
116116
def _current_frames() -> Dict[int, Any]: ...
117117
def displayhook(value: Optional[int]) -> None: ...
118-
def excepthook(type_: type, value: BaseException,
118+
def excepthook(type_: Type[BaseException], value: BaseException,
119119
traceback: TracebackType) -> None: ...
120120
# TODO should be a union of tuple, see mypy#1178
121121
def exc_info() -> Tuple[Optional[Type[BaseException]],

0 commit comments

Comments
 (0)