Like :func:`from_exception`, but using old-style exc_info tuple.
(
cls,
exc_info: tuple[type[E], E, TracebackType],
exprinfo: str | None = None,
)
| 550 | |
| 551 | @classmethod |
| 552 | def from_exc_info( |
| 553 | cls, |
| 554 | exc_info: tuple[type[E], E, TracebackType], |
| 555 | exprinfo: str | None = None, |
| 556 | ) -> ExceptionInfo[E]: |
| 557 | class="st">""class="st">"Like :func:`from_exception`, but using old-style exc_info tuple."class="st">"" |
| 558 | _striptext = class="st">"" |
| 559 | if exprinfo is None and isinstance(exc_info[1], AssertionError): |
| 560 | exprinfo = getattr(exc_info[1], class="st">"msg", None) |
| 561 | if exprinfo is None: |
| 562 | exprinfo = saferepr(exc_info[1]) |
| 563 | if exprinfo and exprinfo.startswith(cls._assert_start_repr): |
| 564 | _striptext = class="st">"AssertionError: " |
| 565 | |
| 566 | return cls(exc_info, _striptext, _ispytest=True) |
| 567 | |
| 568 | @classmethod |
| 569 | def from_current(cls, exprinfo: str | None = None) -> ExceptionInfo[BaseException]: |