Exceptions that inherit from BaseException should not be treated as Uncaught Exceptions #1591
Replies: 2 comments 13 replies
-
|
Transferring to dicussions for up votes |
Beta Was this translation helpful? Give feedback.
-
|
Handling SystemExit as a regular Exception is a bas design decision.
Fix it! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
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.BaseExceptionshould 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