From: Victor Stinner Date: Fri, 19 Aug 2016 14:42:42 +0000 (+0200) Subject: PyEval_CallObjectWithKeywords() uses fast call X-Git-Tag: v3.6.0b1~663 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f745bf1d90a75a0e3df5ba4d59b3ffbb71e3ebc;p=thirdparty%2FPython%2Fcpython.git PyEval_CallObjectWithKeywords() uses fast call Issue #27128: Modify PyEval_CallObjectWithKeywords() to use _PyObject_FastCall() when args==NULL and kw==NULL. It avoids the creation of a temporary empty tuple for positional arguments. --- diff --git a/Python/ceval.c b/Python/ceval.c index b9b21d14be42..75eaa8110a28 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -4592,6 +4592,10 @@ PyEval_CallObjectWithKeywords(PyObject *func, PyObject *arg, PyObject *kw) #endif if (arg == NULL) { + if (kw == NULL) { + return _PyObject_FastCall(func, NULL, 0, 0); + } + arg = PyTuple_New(0); if (arg == NULL) return NULL;