A traceback with optional extra details (function arguments, function locals, file location) and possible extra line emitted at the end.
| 1333 | |
| 1334 | @dataclasses.dataclass(eq=False) |
| 1335 | class ReprTraceback(TerminalRepr): |
| 1336 | """A traceback with optional extra details (function arguments, function |
| 1337 | locals, file location) and possible extra line emitted at the end.""" |
| 1338 | |
| 1339 | reprentries: Sequence[ReprEntry | ReprEntryNative] |
| 1340 | extraline: str | None |
| 1341 | style: TracebackStyle |
| 1342 | |
| 1343 | entrysep: ClassVar = "_ " |
| 1344 | |
| 1345 | def toterminal(self, tw: TerminalWriter) -> None: |
| 1346 | # The entries might have different styles. |
| 1347 | for i, entry in enumerate(self.reprentries): |
| 1348 | if entry.style == "long": |
| 1349 | tw.line("") |
| 1350 | entry.toterminal(tw) |
| 1351 | if i < len(self.reprentries) - 1: |
| 1352 | next_entry = self.reprentries[i + 1] |
| 1353 | if entry.style == "long" or ( |
| 1354 | entry.style == "short" and next_entry.style == "long" |
| 1355 | ): |
| 1356 | tw.sep(self.entrysep) |
| 1357 | |
| 1358 | if self.extraline: |
| 1359 | tw.line(self.extraline) |
| 1360 | |
| 1361 | |
| 1362 | class ReprTracebackNative(ReprTraceback): |
no outgoing calls
no test coverage detected