Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e2333d

Browse files
committed
PyEval_CallObjectWithKeywords() doesn't inc/decref
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.
1 parent 7e7823a commit 6e2333d

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Python/ceval.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4580,8 +4580,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
45804580
PyObject *
45814581
PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
45824582
{
4583-
PyObject *result;
4584-
45854583
#ifdef Py_DEBUG
45864584
/* PyEval_CallObjectWithKeywords() must not be called with an exception
45874585
set. It raises a new exception if parameters are invalid or if
@@ -4605,11 +4603,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs)
46054603
return NULL;
46064604
}
46074605

4608-
Py_INCREF(args);
4609-
result = PyObject_Call(func, args, kwargs);
4610-
Py_DECREF(args);
4611-
4612-
return result;
4606+
return PyObject_Call(func, args, kwargs);
46134607
}
46144608

46154609
const char *

0 commit comments

Comments
 (0)