diff options
Diffstat (limited to 'Modules/_functoolsmodule.c')
-rw-r--r-- | Modules/_functoolsmodule.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Modules/_functoolsmodule.c b/Modules/_functoolsmodule.c index 3413b12dfe..3c82e5134a 100644 --- a/Modules/_functoolsmodule.c +++ b/Modules/_functoolsmodule.c @@ -102,8 +102,17 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw) } } else { - pto->kw = pkw; - Py_INCREF(pkw); + if (pkw == Py_None) { + pto->kw = PyDict_New(); + if (pto->kw == NULL) { + Py_DECREF(pto); + return NULL; + } + } + else { + pto->kw = pkw; + Py_INCREF(pkw); + } } pto->weakreflist = NULL; |