Issue #27809: PyEval_CallObjectWithKeywords() doesn't increment temporary the
reference counter of the args tuple (positional arguments). The caller already
holds a strong reference to it.
PyObject *
PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
{
- PyObject *result;
-
#ifdef Py_DEBUG
/* PyEval_CallObjectWithKeywords() must not be called with an exception
set. It raises a new exception if parameters are invalid or if
return NULL;
}
- Py_INCREF(args);
- result = PyObject_Call(func, args, kwargs);
- Py_DECREF(args);
-
- return result;
+ return PyObject_Call(func, args, kwargs);
}
const char *