From: Victor Stinner Date: Mon, 12 Sep 2016 19:33:26 +0000 (-0400) Subject: Fix warning in _PyCFunction_FastCallKeywords() X-Git-Tag: v3.6.0b2~238^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=476bd5ea97df153cb8faf34f600f2235051ccd8b;p=thirdparty%2FPython%2Fcpython.git Fix warning in _PyCFunction_FastCallKeywords() Issue #28105. --- diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 19e8114d4af3..c2001f0169b0 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) {