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.
This commit is contained in:
Jeremy Hylton 2001-02-09 23:23:20 +00:00
parent c898f2cd3b
commit 8af6b83e61
1 changed files with 0 additions and 10 deletions

View File

@ -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) {