diff options
author | Benjamin Peterson <benjamin@python.org> | 2015-05-09 04:29:08 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2015-05-09 04:29:08 (GMT) |
commit | dae2ef1cfad60b149370b4012aa48bea2dd27445 (patch) | |
tree | 693595202f70ed00e60b57381cc4f76e6c7b9b61 /Modules | |
parent | 43e3d22fee9b22f6f9dec4364ea4ee796faefaab (diff) | |
parent | 65bcdd7195666e20eb56a7d49b5dd0ee2278e506 (diff) | |
download | cpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.zip cpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.tar.gz cpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.tar.bz2 |
merge 3.4
Diffstat (limited to 'Modules')
-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 3413b12..3c82e51 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; |