In addition to what /u/war_against_myself said, a bare except in python will also catch interrupts like SIGKILL due to the exception class hierarchy in Python.
If you want to catch any exception, you should be using except Exception:. That will catch all exceptions, while still ignoring interrupts so you can still kill your code when you want to
View all comments
Show parent comment
4
u/BobHogan Jul 14 '21
In addition to what /u/war_against_myself said, a bare except in python will also catch interrupts like SIGKILL due to the exception class hierarchy in Python.
If you want to catch any exception, you should be using
except Exception:. That will catch all exceptions, while still ignoring interrupts so you can still kill your code when you want to