1 2 3 4 5
import exception_classname a = exception_classname.Exception() if a.testfunc() != 42: raise RuntimeError("Not 42!")