Construct a Bytecode from the given traceback
(cls, tb, *, show_caches=False, adaptive=False)
| 1085 | |
| 1086 | @classmethod |
| 1087 | def from_traceback(cls, tb, *, show_caches=False, adaptive=False): |
| 1088 | """ Construct a Bytecode from the given traceback """ |
| 1089 | while tb.tb_next: |
| 1090 | tb = tb.tb_next |
| 1091 | return cls( |
| 1092 | tb.tb_frame.f_code, current_offset=tb.tb_lasti, show_caches=show_caches, adaptive=adaptive |
| 1093 | ) |
| 1094 | |
| 1095 | def info(self): |
| 1096 | """Return formatted information about the code object.""" |