summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2007-03-21 20:33:57 (GMT)
committerRaymond Hettinger <python@rcn.com>2007-03-21 20:33:57 (GMT)
commite3146f5aa3cbb8d28a6a429b5ccc07002e339ff2 (patch)
treea556c37a974642890483671365acfbc46c3b342d /Objects
parent7492e4260e4f6231f6f30a0f10f514115b9233cb (diff)
downloadcpython-e3146f5aa3cbb8d28a6a429b5ccc07002e339ff2.zip
cpython-e3146f5aa3cbb8d28a6a429b5ccc07002e339ff2.tar.gz
cpython-e3146f5aa3cbb8d28a6a429b5ccc07002e339ff2.tar.bz2
Add test and fix for fromkeys() optional argument.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/dictobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 06cc4a8..7d6ff61 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -1186,8 +1186,8 @@ dict_fromkeys(PyObject *cls, PyObject *args)
while (_PySet_NextEntry(seq, &pos, &key, &hash)) {
Py_INCREF(key);
- Py_INCREF(Py_None);
- if (insertdict(mp, key, hash, Py_None))
+ Py_INCREF(value);
+ if (insertdict(mp, key, hash, value))
return NULL;
}
return d;