Skip to content

Commit cca6ee4

Browse files
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.
1 parent eb09e28 commit cca6ee4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

stdlib/2and3/traceback.pyi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ if sys.version_info >= (3, 5):
9090
def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ...
9191
def format_exception_only(self) -> Generator[str, None, None]: ...
9292

93-
94-
if sys.version_info >= (3, 5):
9593
class FrameSummary(Iterable):
9694
filename: str
9795
lineno: int
@@ -101,7 +99,7 @@ if sys.version_info >= (3, 5):
10199
def __init__(self, filename: str, lineno: int, name: str,
102100
lookup_line: bool = ...,
103101
locals: Optional[Mapping[str, str]] = ...,
104-
line: Optional[int] = ...) -> None: ...
102+
line: Optional[str] = ...) -> None: ...
105103
# TODO: more precise typing for __getitem__ and __iter__,
106104
# for a namedtuple-like view on (filename, lineno, name, str).
107105
def __getitem__(self, i: int) -> Any: ...

0 commit comments

Comments
 (0)