[python] Getting the exception value in Python