summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2015-05-09 04:29:08 (GMT)
committerBenjamin Peterson <benjamin@python.org>2015-05-09 04:29:08 (GMT)
commitdae2ef1cfad60b149370b4012aa48bea2dd27445 (patch)
tree693595202f70ed00e60b57381cc4f76e6c7b9b61 /Modules
parent43e3d22fee9b22f6f9dec4364ea4ee796faefaab (diff)
parent65bcdd7195666e20eb56a7d49b5dd0ee2278e506 (diff)
downloadcpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.zip
cpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.tar.gz
cpython-dae2ef1cfad60b149370b4012aa48bea2dd27445.tar.bz2
merge 3.4
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_functoolsmodule.c13
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;