I want to debug a warning that occurs well into the code's execution.
A simple breakpoint won't do, because the line that results in the warning executes millions of times without warning before the first warning occurs.
Also, the line where this is happening is in library code (more precisely, in pandas/core/common.py
), so my preference is not to modify the code at all.
I just want to stop the program's execution right when it emits the warning, and inspect the stack at this point, either with pdb
or with ipdb
.
Is there a way to configure either debugger to automatically enter single-step mode upon the issuing of a warning?