summaryrefslogtreecommitdiffstats
path: root/Modules/_dbmmodule.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-11-25 19:19:17 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-11-25 19:19:17 (GMT)
commit7317c1ef7aaba7deda66b7fa917d09e68d83635b (patch)
tree20de56e7bef3651ffbe837660673f76a1b54a1c5 /Modules/_dbmmodule.c
parent50d5a1c37324405104a097389515a0ef4f9705f3 (diff)
downloadcpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.zip
cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.tar.gz
cpython-7317c1ef7aaba7deda66b7fa917d09e68d83635b.tar.bz2
dbm.gnu and dbm.ndbm accept both strings and bytes as keys and values. For the
former they are converted to bytes before being written to the DB. Closes issue 3799. Reviewed by Skip Montanaro.
Diffstat (limited to 'Modules/_dbmmodule.c')
-rw-r--r--Modules/_dbmmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_dbmmodule.c b/Modules/_dbmmodule.c
index d43acdc..1aef3d9 100644
--- a/Modules/_dbmmodule.c
+++ b/Modules/_dbmmodule.c
@@ -122,7 +122,7 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w)
if ( !PyArg_Parse(v, "s#", &krec.dptr, &tmp_size) ) {
PyErr_SetString(PyExc_TypeError,
- "dbm mappings have string keys only");
+ "dbm mappings have bytes or string keys only");
return -1;
}
krec.dsize = tmp_size;
@@ -140,7 +140,7 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w)
} else {
if ( !PyArg_Parse(w, "s#", &drec.dptr, &tmp_size) ) {
PyErr_SetString(PyExc_TypeError,
- "dbm mappings have byte string elements only");
+ "dbm mappings have byte or string elements only");
return -1;
}
drec.dsize = tmp_size;