summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/classobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 27a82f9..083759cd 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -1114,7 +1114,7 @@ halfbinop(v, w, opname, r_result, thisfunc, swapped)
func = PyObject_GetAttrString(v, opname);
if (func == NULL) {
Py_XDECREF(coerced);
- if (PyErr_Occurred() != PyExc_AttributeError)
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError))
return -1;
PyErr_Clear();
return 1;