From a648f5eee1c0df97d9575fee5cb8be35657c21b0 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 5 Feb 2016 11:22:45 -0800 Subject: [PATCH] Fix incorrect sys.exit() type. --- stdlib/2.7/sys.pyi | 3 ++- stdlib/3/sys.pyi | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/stdlib/2.7/sys.pyi b/stdlib/2.7/sys.pyi index 04994b25f..8bd920fad 100644 --- a/stdlib/2.7/sys.pyi +++ b/stdlib/2.7/sys.pyi @@ -109,7 +109,8 @@ def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) def exc_clear() -> None: raise DeprecationWarning() def exc_info() -> Tuple[type, BaseException, TracebackType]: ... -def exit(arg: int = ...) -> None: +# sys.exit() accepts an optional argument of anything printable +def exit(arg: Any = ...) -> None: raise SystemExit() def getcheckinterval() -> int: ... # deprecated def getdefaultencoding() -> str: ... diff --git a/stdlib/3/sys.pyi b/stdlib/3/sys.pyi index a7e4cfe21..e53320433 100644 --- a/stdlib/3/sys.pyi +++ b/stdlib/3/sys.pyi @@ -115,7 +115,9 @@ def displayhook(value: Optional[int]) -> None: ... def excepthook(type_: type, value: BaseException, traceback: TracebackType) -> None: ... def exc_info() -> Tuple[type, BaseException, TracebackType]: ... -def exit(arg: Union[int, str] = ...) -> None: ... +# sys.exit() accepts an optional argument of anything printable +def exit(arg: Any = ...) -> None: + raise SystemExit() def getcheckinterval() -> int: ... # deprecated def getdefaultencoding() -> str: ... def getdlopenflags() -> int: ... # Unix only