Is there any way to make a python program start an interactive debugger, like what import pdb; pdb.set_trace() instead of actually throwing an exception?
I wrote a package to start pdb on exception. It takes @boreis-gorelik's answer, and modifies the interpreter state at runtime so no code changes are necessary:
Installation
pip install mort
Usage
mort
When the exception occurs, the pdb repl should start in the given terminal