Initialize from given python traceback object and ExceptionInfo.
(
self,
tb: TracebackType | Iterable[TracebackEntry],
)
| 359 | """Traceback objects encapsulate and offer higher level access to Traceback entries.""" |
| 360 | |
| 361 | def __init__( |
| 362 | self, |
| 363 | tb: TracebackType | Iterable[TracebackEntry], |
| 364 | ) -> None: |
| 365 | """Initialize from given python traceback object and ExceptionInfo.""" |
| 366 | if isinstance(tb, TracebackType): |
| 367 | |
| 368 | def f(cur: TracebackType) -> Iterable[TracebackEntry]: |
| 369 | cur_: TracebackType | None = cur |
| 370 | while cur_ is not None: |
| 371 | yield TracebackEntry(cur_) |
| 372 | cur_ = cur_.tb_next |
| 373 | |
| 374 | super().__init__(f(tb)) |
| 375 | else: |
| 376 | super().__init__(tb) |
| 377 | |
| 378 | def cut( |
| 379 | self, |