In Python is there any language (or interpreter) feature to force the python interpreter to always raise exceptions even if the exception offending code is inside a try/except block ?
I've just inherited a larger and old codebase written in python, whose purpose is to communicate with some custom designed hardware we also developed. Many communication errors and timeouts are being masked/missed due to the following (simplified) pattern of code:
try:
serialport.write(MSG)
except:
some_logging_function_mostly_not_working_that_might_be_here_or_not()
#or just:
#pass
In order to avoid the typical scenario of "just rewrite the whole thing from scratch", I'm currently trying to fix all exceptions errors/timeouts. I'm doing this by disabling by hand the all exception handling code, one at a time.