When I debug a loop, the debugger quits when it encounters an error. Is it possible to stay inside the debugger so that I can investigate the program's state right before the error?
For example,
import pdb;pdb.set_trace()
for i in [1, 2, 3, 0]:
print(2/i)
I would like to hit c
so that the debugger keeps running through the loop until the last iteration. Then, instead of quitting, the debugger stays active so that I can look at what is the value of i
that is causing the error.