summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-02-09 23:23:20 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-02-09 23:23:20 (GMT)
commit8af6b83e61f1f5b4501968b77a17ad6ef96984c4 (patch)
tree908ef47bc3f48101fbc6016d6cf680a861d9e2a6 /Python/ceval.c
parentc898f2cd3ba15d6b315a3525e7c3c8c59f99c609 (diff)
downloadcpython-8af6b83e61f1f5b4501968b77a17ad6ef96984c4.zip
cpython-8af6b83e61f1f5b4501968b77a17ad6ef96984c4.tar.gz
cpython-8af6b83e61f1f5b4501968b77a17ad6ef96984c4.tar.bz2
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.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 9d65495..8a83e99 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) {