(t=None)
| 48 | |
| 49 | |
| 50 | def post_mortem(t=None): |
| 51 | # handling the default |
| 52 | if t is None: |
| 53 | # sys.exc_info() returns (type, value, traceback) if an exception is |
| 54 | # being handled, otherwise it returns None |
| 55 | t = sys.exc_info()[2] |
| 56 | if t is None: |
| 57 | raise ValueError( |
| 58 | "A valid traceback must be passed if no exception is being handled." |
| 59 | ) |
| 60 | |
| 61 | p = BPdb() |
| 62 | p.reset() |
| 63 | p.interaction(None, t) |
| 64 | |
| 65 | |
| 66 | def pm(): |