From 00758f39ddbc82fb681f93d02fbafb2eae183544 Mon Sep 17 00:00:00 2001 From: Max Wittek Date: Fri, 26 Feb 2016 18:03:24 -0800 Subject: [PATCH] Fixed 2.7 stubs for traceback --- stdlib/2.7/traceback.pyi | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/stdlib/2.7/traceback.pyi b/stdlib/2.7/traceback.pyi index b40710707..4101c207f 100644 --- a/stdlib/2.7/traceback.pyi +++ b/stdlib/2.7/traceback.pyi @@ -1,17 +1,19 @@ from typing import Any, IO, AnyStr, Callable, Tuple, List from types import TracebackType, FrameType +ExtractTbResult = List[Tuple[str, int, str, str]] + 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 = ...) -> 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]]: ... -def extract_stack(f: FrameType = ..., limit: int = ...) -> None: ... -def format_list(list: List[Tuple[str, int, str, str]]) -> str: ... +def print_stack(f: FrameType = ..., limit: int = ..., file: IO[AnyStr] = ...) -> None: ... +def extract_tb(f: TracebackType, limit: int = ...) -> ExtractTbResult: ... +def extract_stack(f: FrameType = ..., limit: int = ...) -> ExtractTbResult: ... +def format_list(list: ExtractTbResult) -> List[str]: ... def format_exception_only(type: type, value: List[str]) -> str: ... -def format_exception(type: type, value: List[str], tb: TracebackType, limit: int) -> str: ... -def format_tb(f: TracebackType, limit: int = ...) -> str: ... -def format_stack(f: FrameType = ..., limit: int = ...) -> str: ... +def format_exception(type: type, value: List[str], tb: TracebackType, limit: int = ...) -> str: ... +def format_tb(f: TracebackType, limit: int = ...) -> List[str]: ... +def format_stack(f: FrameType = ..., limit: int = ...) -> List[str]: ... def tb_lineno(tb: TracebackType) -> AnyStr: ...