From 4ae4714e00b167d4280b379cab66ea6f15b0c0d3 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 11 Jul 2019 11:43:37 +0300 Subject: [PATCH] sys: refine the return type of sys.exc_info() (#3111) --- stdlib/2/sys.pyi | 2 +- stdlib/3/sys.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2/sys.pyi b/stdlib/2/sys.pyi index e67b26325..2b38c6da0 100644 --- a/stdlib/2/sys.pyi +++ b/stdlib/2/sys.pyi @@ -8,7 +8,7 @@ from types import FrameType, ModuleType, TracebackType, ClassType # The following type alias are stub-only and do not exist during runtime _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] -_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] +_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] class _flags: bytes_warning: int diff --git a/stdlib/3/sys.pyi b/stdlib/3/sys.pyi index 3f856bbc9..911ff4fe9 100644 --- a/stdlib/3/sys.pyi +++ b/stdlib/3/sys.pyi @@ -16,7 +16,7 @@ _T = TypeVar('_T') # The following type alias are stub-only and do not exist during runtime _ExcInfo = Tuple[Type[BaseException], BaseException, TracebackType] -_OptExcInfo = Tuple[Optional[Type[BaseException]], Optional[BaseException], Optional[TracebackType]] +_OptExcInfo = Union[_ExcInfo, Tuple[None, None, None]] # ----- sys variables ----- abiflags: str