Call PyErr_Clear() to clear the AttributeError raised by GetAttr.
diff --git a/Objects/classobject.c b/Objects/classobject.c
index f1fd31f..0b595b9 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -1460,6 +1460,7 @@
 	if (func == NULL) {
 		if (!PyErr_ExceptionMatches(PyExc_AttributeError))
 			return NULL;
+		PyErr_Clear();
 		return instance_pow(v, w, z);
 	}
 	args = Py_BuildValue("(OO)", w, z);