summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 8d213b2..cdd3706 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2047,7 +2047,11 @@ PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw)
ternaryfunc call;
if ((call = func->ob_type->tp_call) != NULL) {
- PyObject *result = (*call)(func, arg, kw);
+ PyObject *result;
+ if (Py_EnterRecursiveCall(" while calling a Python object"))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
if (result == NULL && !PyErr_Occurred())
PyErr_SetString(
PyExc_SystemError,