summaryrefslogtreecommitdiff
path: root/Objects/methodobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-12 15:33:26 -0400
committerVictor Stinner <victor.stinner@gmail.com>2016-09-12 15:33:26 -0400
commitf82037329c779713994ac5de1c56d3aa25467c18 (patch)
tree314ad135ce2414d2b0364c9b31e8a14e319fd6f2 /Objects/methodobject.c
parent3f9f6847d5ba68353cdc0df6d0c854e79d13ad95 (diff)
downloadcpython-f82037329c779713994ac5de1c56d3aa25467c18.tar.gz
Fix warning in _PyCFunction_FastCallKeywords()
Issue #28105.
Diffstat (limited to 'Objects/methodobject.c')
-rw-r--r--Objects/methodobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 19e8114d4a..c2001f0169 100644
--- a/Objects/methodobject.c
+++ b/Objects/methodobject.c
@@ -273,7 +273,7 @@ _PyCFunction_FastCallKeywords(PyObject *func, PyObject **stack,
Py_ssize_t nargs, PyObject *kwnames)
{
PyObject *kwdict, *result;
- Py_ssize_t nkwargs;
+ Py_ssize_t nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
assert(PyCFunction_Check(func));
assert(nargs >= 0);
@@ -282,7 +282,6 @@ _PyCFunction_FastCallKeywords(PyObject *func, PyObject **stack,
/* kwnames must only contains str strings, no subclass, and all keys must
be unique */
- nkwargs = (kwnames == NULL) ? 0 : PyTuple_GET_SIZE(kwnames);
if (nkwargs > 0) {
kwdict = _PyStack_AsDict(stack + nargs, kwnames);
if (kwdict == NULL) {