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.
This commit is contained in:
Nathaniel Manista
2018-09-21 16:58:25 -07:00
committed by Jelle Zijlstra
parent eb09e2898b
commit cca6ee43e6

View File

@@ -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: ...