diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_functoolsmodule.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 57dfba0..24da677 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -54,17 +54,13 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw) Py_DECREF(pto); return NULL; } - if (kw != NULL) { - pto->kw = PyDict_Copy(kw); - if (pto->kw == NULL) { - Py_DECREF(pto); - return NULL; - } - } else { - pto->kw = Py_None; - Py_INCREF(Py_None); + pto->kw = (kw != NULL) ? PyDict_Copy(kw) : PyDict_New(); + if (pto->kw == NULL) { + Py_DECREF(pto); + return NULL; } + pto->weakreflist = NULL; pto->dict = NULL; |