0

I'm using PyCharm for debugging. One of the big headaches that I keep having is that even in debug mode, the IDE exits on an exception instead of breaking. There are already questions about this issue but they're all years or even a decade old, and PyCharm's UI has been heavily redesigned in the past years. Here's the Breakpoints window. Link to the image (not enough reputation :(): https://i.sstatic.net/XPl1Z.jpg) If I check the 'On raise' box, it breaks on handled exceptions which is unnecessary and unwieldy. Here's the debug console. I want it to break on the failed assert instead of just exiting. https://i.sstatic.net/4n6Q6.jpg

2 Answers 2

3

Your settings seem OK. When I tried to reproduce the case the PyCharm IDE just stopped right at the AssertationError. Note the debug window in the bottom of the GUI where you can inspect the stack trace and variables. The last line Process finished with exit code 1 of your screenshot was not printed at that point.

Possible cases for exiting:

This question is a possible duplicate for Break on unhandled exception in pycharm

0

I had this problem, and for me it was an incorrect setting, as suggested in Break on unhandled exception in pycharm

The solution for me was to go to Run > Breakpoints and to enable Python Exception Breakpoint and Any Exception below it. For some reason that was switched off.

Edit: I just realized that you already have this setting enabled, so this is not the solution for your problem, but I'll leave this answer here in case someone else stumbles upon the same issue.

Not the answer you're looking for? Browse other questions tagged or ask your own question.