summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2016-09-12 19:33:26 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2016-09-12 19:33:26 (GMT)
commit476bd5ea97df153cb8faf34f600f2235051ccd8b (patch)
treeb5b296755690816625c848d6aede9af981ba0813
parent44abad14a3e069fe78c2d5e0a29285bc08031054 (diff)
downloadcpython-476bd5ea97df153cb8faf34f600f2235051ccd8b.zip
cpython-476bd5ea97df153cb8faf34f600f2235051ccd8b.tar.gz
cpython-476bd5ea97df153cb8faf34f600f2235051ccd8b.tar.bz2
Fix warning in _PyCFunction_FastCallKeywords()
Issue #28105.
-rw-r--r--Objects/methodobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c
index 19e8114..c2001f0 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) {