Skip to content

Commit 7b76363

Browse files
committed
fix sys.exc_info return type
1 parent a32d8a9 commit 7b76363

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

stdlib/2.7/sys.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ def __displayhook__(value: int) -> None: ...
108108
def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ...
109109
def exc_clear() -> None:
110110
raise DeprecationWarning()
111-
def exc_info() -> Tuple[type, BaseException, TracebackType]: ...
111+
# TODO should be a union of tuple, see mypy#1178
112+
def exc_info() -> Tuple[Optional[type], Optional[BaseException], Optional[TracebackType]]
113+
112114
# sys.exit() accepts an optional argument of anything printable
113115
def exit(arg: Any = ...) -> None:
114116
raise SystemExit()

stdlib/3/sys.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,8 @@ def _current_frames() -> Dict[int, Any]: ...
117117
def displayhook(value: Optional[int]) -> None: ...
118118
def excepthook(type_: type, value: BaseException,
119119
traceback: TracebackType) -> None: ...
120-
def exc_info() -> Tuple[type, BaseException, TracebackType]: ...
120+
# TODO should be a union of tuple, see mypy#1178
121+
def exc_info() -> Tuple[Optional[type], Optional[BaseException], Optional[TracebackType]]
121122
# sys.exit() accepts an optional argument of anything printable
122123
def exit(arg: Any = ...) -> None:
123124
raise SystemExit()

0 commit comments

Comments
 (0)