diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-19 15:12:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-19 15:12:23 (GMT) |
commit | 8a31c820930536ffe3b44d99252ba9f3bb98ce58 (patch) | |
tree | d5952e59fdcb67329576d4ce63b258e844716546 /Python | |
parent | 0d1a799343dd956c8e4a1d6e0ac3fa9ac007704e (diff) | |
download | cpython-8a31c820930536ffe3b44d99252ba9f3bb98ce58.zip cpython-8a31c820930536ffe3b44d99252ba9f3bb98ce58.tar.gz cpython-8a31c820930536ffe3b44d99252ba9f3bb98ce58.tar.bz2 |
Fix PyObject_Call() parameter names
Issue #27128: arg=>args, kw=>kwargs.
Same change for PyEval_CallObjectWithKeywords().
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 75eaa81..905859e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4580,7 +4580,7 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf) The arg must be a tuple or NULL. The kw must be a dict or NULL. */ PyObject * -PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw) +PyEval_CallObjectWithKeywords(PyObject *func, PyObject *args, PyObject *kwargs) { PyObject *result; @@ -4591,32 +4591,33 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw) assert(!PyErr_Occurred()); #endif - if (arg == NULL) { - if (kw == NULL) { + if (args == NULL) { + if (kwargs == NULL) { return _PyObject_FastCall(func, NULL, 0, 0); } - arg = PyTuple_New(0); - if (arg == NULL) + args = PyTuple_New(0); + if (args == NULL) return NULL; } - else if (!PyTuple_Check(arg)) { + else if (!PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, "argument list must be a tuple"); return NULL; } - else - Py_INCREF(arg); + else { + Py_INCREF(args); + } - if (kw != NULL && !PyDict_Check(kw)) { + if (kwargs != NULL && !PyDict_Check(kwargs)) { PyErr_SetString(PyExc_TypeError, "keyword list must be a dictionary"); - Py_DECREF(arg); + Py_DECREF(args); return NULL; } - result = PyObject_Call(func, arg, kw); - Py_DECREF(arg); + result = PyObject_Call(func, args, kwargs); + Py_DECREF(args); return result; } |