Exceptions that inherit from BaseException should not be treated as Uncaught Exceptions #1591
Unanswered
danielniccoli
asked this question in
Enhancements
Replies: 1 comment 9 replies
-
Transferring to dicussions for up votes |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
Actual behavior
exit(1)
halts the debugging session due to an "uncaught exception"Expected behavior
The program program should exit without the debugger halting.
Exceptions that inherit from
exception.BaseException
should not fall under the category of "uncaught exceptions", since they are "technically not an error"1.https://docs.python.org/3/library/exceptions.html#BaseException
One of these exceptions is
exception.SystemExit
, which is called when callingexit(1)
.https://docs.python.org/3/library/exceptions.html#SystemExit
There are only three other Exceptions that inherit from
exception.BaseException
, not countingexception.Exception
, which does fall under the category of "Uncaught Exceptions":https://docs.python.org/3/library/exceptions.html#exception-hierarchy
Footnotes
https://docs.python.org/3/library/exceptions.html#GeneratorExit ↩
Beta Was this translation helpful? Give feedback.
All reactions