Avoid crashing debugged program with a bdb.BdbQuit exception ☠️
Finally got into using pudb for developing https://github.com/ranger/ranger/ but was annoyed by the crash everytime I wanted to quit the debugger.. wonder why this hasn't been reported before? but was happy the fix is so simple after diving into it a bit. Or do you think this is the wrong approach?
Thanks for the contribution! Unfortunately, I don't think this is quite the right approach, and I'm not super sold anything needs fixing.
First, it's important to distinguish two scenarios: If the program is run via python -m pudb, there should be no BdbQuit exception. Meanwhile, if a program is stopped by calling pudb.set_trace(), then, upon hitting q, a BdbQuit traceback appears. However that matches the behavior of pdb, and I also don't know exactly how we could catch that exception without also resuming program execution (which is available by pressing c if desired).