(t=None)
| 1698 | # Post-Mortem interface |
| 1699 | |
| 1700 | def post_mortem(t=None): |
| 1701 | # handling the default |
| 1702 | if t is None: |
| 1703 | # sys.exc_info() returns (type, value, traceback) if an exception is |
| 1704 | # being handled, otherwise it returns None |
| 1705 | t = sys.exc_info()[2] |
| 1706 | if t is None: |
| 1707 | raise ValueError("A valid traceback must be passed if no " |
| 1708 | "exception is being handled") |
| 1709 | |
| 1710 | p = Pdb() |
| 1711 | p.reset() |
| 1712 | p.interaction(None, t) |
| 1713 | |
| 1714 | def pm(): |
| 1715 | post_mortem(sys.last_traceback) |
no test coverage detected