summaryrefslogtreecommitdiff
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index dc6689310d..20e171119f 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2137,8 +2137,10 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls)
if (checker != NULL) {
PyObject *res;
int ok = -1;
- if (Py_EnterRecursiveCall(" in __instancecheck__"))
+ if (Py_EnterRecursiveCall(" in __instancecheck__")) {
+ Py_DECREF(checker);
return ok;
+ }
res = PyObject_CallFunctionObjArgs(checker, inst, NULL);
Py_LeaveRecursiveCall();
Py_DECREF(checker);