/** * Determine whether obj is a Python exception class * * @param obj a PyObject * @return true if an exception */ public static boolean isExceptionClass(PyObject obj) { if (obj instanceof PyClass) { return true; } return isPy3kExceptionClass(obj); }
} else if (Options.py3k_warning && !isPy3kExceptionClass(exc)) { Py.DeprecationWarning("catching classes that don't inherit from BaseException is not " + "allowed in 3.x");