summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 9532e32..9671692 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -95,14 +95,12 @@ PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
/* */
#define PyExceptionClass_Check(x) \
- (PyClass_Check((x)) \
- || (PyType_Check((x)) && PyType_IsSubtype( \
- (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException)))
-
+ (PyClass_Check((x)) || (PyType_Check((x)) && \
+ PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS)))
#define PyExceptionInstance_Check(x) \
(PyInstance_Check((x)) || \
- (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException)))
+ PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS))
#define PyExceptionClass_Name(x) \
(PyClass_Check((x)) \