mirror of
https://github.com/cool-RR/PySnooper.git
synced 2026-07-17 16:36:24 +00:00
The tracer reads co_code[frame.f_lasti] to decide whether a 'return' event was caused by an exception. f_lasti can be -1 (e.g. a frame that hasn't executed an instruction), and co_code[-1] reads the last byte -- the wrong opcode -- which can misreport a normal return as "Call ended by exception". Extract the check into call_ended_by_exception() and return False when f_lasti < 0. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| pycompat.py | ||
| tracer.py | ||
| utils.py | ||
| variables.py | ||