From 8af6b83e61f1f5b4501968b77a17ad6ef96984c4 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Fri, 9 Feb 2001 23:23:20 +0000 Subject: [PATCH] When calling a PyCFunction that has METH_KEYWORDS defined, don't create an empty dictionary if it is called without keyword args. Just pass NULL. XXX I had believed that this caused weird errors, but the test suite runs cleanly. --- Python/ceval.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Python/ceval.c b/Python/ceval.c index 9d6549572f5..8a83e99eada 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2728,16 +2728,6 @@ call_cfunction(PyObject *func, PyObject *arg, PyObject *kw) int flags = PyCFunction_GET_FLAGS(func); if (flags & METH_KEYWORDS) { - if (kw == NULL) { - static PyObject *dict = NULL; - if (dict == NULL) { - dict = PyDict_New(); - if (dict == NULL) - return NULL; - } - kw = dict; - Py_INCREF(dict); - } return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); } if (kw != NULL && PyDict_Size(kw) != 0) {