Skip to content

Commit 4ae4714

Browse files
bluetechsrittau
authored andcommitted
sys: refine the return type of sys.exc_info() (#3111)
1 parent b43e1d6 commit 4ae4714

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/2/sys.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ from types import FrameType, ModuleType, TracebackType, ClassType
88

99
# The following type alias are stub-only and do not exist during runtime
1010
_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType]
11-
_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
11+
_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]]
1212

1313
class _flags:
1414
bytes_warning: int

stdlib/3/sys.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _T = TypeVar('_T')
1616

1717
# The following type alias are stub-only and do not exist during runtime
1818
_ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType]
19-
_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]]
19+
_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]]
2020

2121
# ----- sys variables -----
2222
abiflags: str

0 commit comments

Comments
 (0)