From cca6ee43e6c6c92b4b0d4c842667bfc1ea35f352 Mon Sep 17 00:00:00 2001 From: Nathaniel Manista Date: Fri, 21 Sep 2018 16:58:25 -0700 Subject: [PATCH] Fix traceback.FrameSummary's "line" parameter (#2470) traceback.FrameSummary's "line" parameter is a string that is the text of a line of code, not an int that is the line number of a line of code. --- stdlib/2and3/traceback.pyi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stdlib/2and3/traceback.pyi b/stdlib/2and3/traceback.pyi index 94e4153fb..3b77df261 100644 --- a/stdlib/2and3/traceback.pyi +++ b/stdlib/2and3/traceback.pyi @@ -90,8 +90,6 @@ if sys.version_info >= (3, 5): def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ... def format_exception_only(self) -> Generator[str, None, None]: ... - -if sys.version_info >= (3, 5): class FrameSummary(Iterable): filename: str lineno: int @@ -101,7 +99,7 @@ if sys.version_info >= (3, 5): def __init__(self, filename: str, lineno: int, name: str, lookup_line: bool = ..., locals: Optional[Mapping[str, str]] = ..., - line: Optional[int] = ...) -> None: ... + line: Optional[str] = ...) -> None: ... # TODO: more precise typing for __getitem__ and __iter__, # for a namedtuple-like view on (filename, lineno, name, str). def __getitem__(self, i: int) -> Any: ...