Private version of post_mortem, which allow to pass a pdb instance for testing purposes.
(t, pdb_instance)
| 3522 | |
| 3523 | |
| 3524 | def _post_mortem(t, pdb_instance): |
| 3525 | """ |
| 3526 | Private version of post_mortem, which allow to pass a pdb instance |
| 3527 | for testing purposes. |
| 3528 | """ |
| 3529 | # handling the default |
| 3530 | if t is None: |
| 3531 | exc = sys.exception() |
| 3532 | if exc is not None: |
| 3533 | t = exc.__traceback__ |
| 3534 | |
| 3535 | if t is None or (isinstance(t, BaseException) and t.__traceback__ is None): |
| 3536 | raise ValueError("A valid traceback must be passed if no " |
| 3537 | "exception is being handled") |
| 3538 | |
| 3539 | pdb_instance.reset() |
| 3540 | pdb_instance.interaction(None, t) |
| 3541 | |
| 3542 | |
| 3543 | def pm(): |
no test coverage detected
searching dependent graphs…