Disassemble a traceback (default: last traceback).
(tb=None, *, file=None, show_caches=False, adaptive=False)
| 111 | type(x).__name__) |
| 112 | |
| 113 | def distb(tb=None, *, file=None, show_caches=False, adaptive=False): |
| 114 | """Disassemble a traceback (default: last traceback).""" |
| 115 | if tb is None: |
| 116 | try: |
| 117 | tb = sys.last_traceback |
| 118 | except AttributeError: |
| 119 | raise RuntimeError("no last traceback to disassemble") from None |
| 120 | while tb.tb_next: tb = tb.tb_next |
| 121 | disassemble(tb.tb_frame.f_code, tb.tb_lasti, file=file, show_caches=show_caches, adaptive=adaptive) |
| 122 | |
| 123 | # The inspect module interrogates this dictionary to build its |
| 124 | # list of CO_* constants. It is also used by pretty_flags to |