Skip to content

Commit c40a260

Browse files
tharvikgvanrossum
authored andcommitted
fix sys.exc_info return type (#246)
1 parent 4039a1a commit c40a260

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

stdlib/2.7/sys.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ 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],
113+
Optional[BaseException],
114+
Optional[TracebackType]]: ...
115+
112116
# sys.exit() accepts an optional argument of anything printable
113117
def exit(arg: Any = ...) -> None:
114118
raise SystemExit()

stdlib/3/sys.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ 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],
122+
Optional[BaseException],
123+
Optional[TracebackType]]: ...
121124
# sys.exit() accepts an optional argument of anything printable
122125
def exit(arg: Any = ...) -> None:
123126
raise SystemExit()

0 commit comments

Comments
 (0)