diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-22 22:25:01 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-22 22:25:01 (GMT) |
commit | 6e2333dfdf54f052fcf404086141e820da3af8fb (patch) | |
tree | ad09bdeedf7c5f38daf4f3b4d23fcba4d861de81 /Python/ceval.c | |
parent | 7e7823a03785925573b732be30e97f8585272f18 (diff) | |
download | cpython-6e2333dfdf54f052fcf404086141e820da3af8fb.zip cpython-6e2333dfdf54f052fcf404086141e820da3af8fb.tar.gz cpython-6e2333dfdf54f052fcf404086141e820da3af8fb.tar.bz2 |
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index fd456ce..f9759f0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4580,8 +4580,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf) 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 @@ -4605,11 +4603,7 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) return NULL; } - Py_INCREF(args); - result = PyObject_Call(func, args, kwargs); - Py_DECREF(args); - - return result; + return PyObject_Call(func, args, kwargs); } const char * |