(t=None)
| 1623 | # Post-Mortem interface |
| 1624 | |
| 1625 | def post_mortem(t=None): |
| 1626 | # handling the default |
| 1627 | if t is None: |
| 1628 | # sys.exc_info() returns (type, value, traceback) if an exception is |
| 1629 | # being handled, otherwise it returns None |
| 1630 | t = sys.exc_info()[2] |
| 1631 | if t is None: |
| 1632 | raise ValueError("A valid traceback must be passed if no " |
| 1633 | "exception is being handled") |
| 1634 | |
| 1635 | p = Pdb() |
| 1636 | p.reset() |
| 1637 | p.interaction(None, t) |
| 1638 | |
| 1639 | def pm(): |
| 1640 | post_mortem(sys.last_traceback) |
no test coverage detected