2 ms·
This is NOT OK. You're swallowing all exceptions and assuming that they are your special case. The fix is to have a specific nonambiguous name for your except
by btilly 13y ago
This is NOT OK. You're swallowing all exceptions and assuming that they are your special case.
The fix is to have a specific nonambiguous name for your exception, so that other error conditions still work properly. As examples consider the StopIteration and GeneratorExit exceptions from Python's standard library. (See http://docs.python.org/2/library/exceptions.html http://docs.python.org/2/library/exceptions.html for a list of built-in exceptions.)