From 55830ec1900d48adce1f6b02a3418b16affd0c42 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Mon, 25 Jan 2016 16:43:48 -0800 Subject: [PATCH] Fix type for py2 traceback.format_exc and add to python 3. --- stdlib/2.7/traceback.pyi | 2 +- stdlib/3/traceback.pyi | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/2.7/traceback.pyi b/stdlib/2.7/traceback.pyi index fab65f5db..c00e8fbb3 100644 --- a/stdlib/2.7/traceback.pyi +++ b/stdlib/2.7/traceback.pyi @@ -4,7 +4,7 @@ from types import TracebackType, FrameType def print_tb(traceback: TracebackType, limit: int = ..., file: IO[str] = ...) -> None: ... def print_exception(type: type, value: Exception, limit: int = ..., file: IO[str] = ...) -> None: ... def print_exc(limit: int = ..., file: IO[str] = ...) -> None: ... -def format_exc(limit: int = ...) -> None: ... +def format_exc(limit: int = ...) -> str: ... def print_last(limit: int = ..., file: IO[str] = ...) -> None: ... def print_stack(f: FrameType, limit: int = ..., file: IO[AnyStr] = ...) -> None: ... def extract_tb(f: TracebackType, limit: int = ...) -> List[Tuple[str, int, str, str]]: ... diff --git a/stdlib/3/traceback.pyi b/stdlib/3/traceback.pyi index a5953568d..7fca4aa65 100644 --- a/stdlib/3/traceback.pyi +++ b/stdlib/3/traceback.pyi @@ -6,6 +6,7 @@ import typing def format_exception_only(etype, value): ... def format_tb(traceback): ... def print_exc(limit=..., file=..., chain=...): ... +def format_exc(limit: int, chain: bool = ...) -> str: ... def extract_stack(f=..., limit=...): ... def extract_tb(traceback, limit=...): ... def format_list(list): ...