summaryrefslogtreecommitdiff
path: root/Include/pyerrors.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/pyerrors.h')
-rw-r--r--Include/pyerrors.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/Include/pyerrors.h b/Include/pyerrors.h
index 67f1909d9e..562af10a42 100644
--- a/Include/pyerrors.h
+++ b/Include/pyerrors.h
@@ -94,13 +94,12 @@ PyAPI_FUNC(void) PyErr_NormalizeException(PyObject**, PyObject**, PyObject**);
/* */
-#define PyExceptionClass_Check(x) \
- (PyType_Check((x)) && PyType_IsSubtype( \
- (PyTypeObject*)(x), (PyTypeObject*)PyExc_BaseException))
+#define PyExceptionClass_Check(x) \
+ (PyType_Check((x)) && \
+ PyType_FastSubclass((PyTypeObject*)(x), Py_TPFLAGS_BASE_EXC_SUBCLASS))
-
-#define PyExceptionInstance_Check(x) \
- (PyType_IsSubtype((x)->ob_type, (PyTypeObject*)PyExc_BaseException))
+#define PyExceptionInstance_Check(x) \
+ PyType_FastSubclass((x)->ob_type, Py_TPFLAGS_BASE_EXC_SUBCLASS)
#define PyExceptionClass_Name(x) \
((char *)(((PyTypeObject*)(x))->tp_name))