There are four exceptions in the Python2 documentation that are derived from BaseException :
BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception
Three that are not Exception are not really errors, which means you donβt want to catch them at all, as if they were errors. BaseException was added in Python2.5 (before that there was no BaseException , and the rest of the exceptions were subclassed from Exception ).
source share