I want to catch a Python exception and print it rather than re-raising it. For example:
def f(x): try: return 1/x except: print <exception_that_was_raised> This should then do:
>>> f(0) 'ZeroDivisionError' without an exception being raised.
Is there a way to do this, other than listing each possible exception in a giant try-except-except...except clause?