Disassemble a traceback (default: last traceback).
(tb=None, *, file=None, show_caches=False, adaptive=False, show_offsets=False, show_positions=False)
| 138 | type(x).__name__) |
| 139 | |
| 140 | def distb(tb=None, *, file=None, show_caches=False, adaptive=False, show_offsets=False, show_positions=False): |
| 141 | """Disassemble a traceback (default: last traceback).""" |
| 142 | if tb is None: |
| 143 | try: |
| 144 | if hasattr(sys, 'last_exc'): |
| 145 | tb = sys.last_exc.__traceback__ |
| 146 | else: |
| 147 | tb = sys.last_traceback |
| 148 | except AttributeError: |
| 149 | raise RuntimeError("no last traceback to disassemble") from None |
| 150 | while tb.tb_next: tb = tb.tb_next |
| 151 | disassemble(tb.tb_frame.f_code, tb.tb_lasti, file=file, show_caches=show_caches, adaptive=adaptive, show_offsets=show_offsets, show_positions=show_positions) |
| 152 | |
| 153 | # The inspect module interrogates this dictionary to build its |
| 154 | # list of CO_* constants. It is also used by pretty_flags to |
no test coverage detected
searching dependent graphs…