summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/abstract.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 0ec6dee..6d948d4 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2907,22 +2907,20 @@ int
PyObject_IsInstance(PyObject *inst, PyObject *cls)
{
static PyObject *name = NULL;
- PyObject *t, *v, *tb;
PyObject *checker;
/* Quick test for an exact match */
if (Py_TYPE(inst) == (PyTypeObject *)cls)
return 1;
- PyErr_Fetch(&t, &v, &tb);
-
if (name == NULL) {
name = PyString_InternFromString("__instancecheck__");
if (name == NULL)
return -1;
}
checker = PyObject_GetAttr(cls, name);
- PyErr_Restore(t, v, tb);
+ if (checker == NULL && PyErr_Occurred())
+ PyErr_Clear();
if (checker != NULL) {
PyObject *res;
int ok = -1;