From 7317c1ef7aaba7deda66b7fa917d09e68d83635b Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Tue, 25 Nov 2008 19:19:17 +0000 Subject: 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. --- Modules/_gdbmmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Modules/_gdbmmodule.c') diff --git a/Modules/_gdbmmodule.c b/Modules/_gdbmmodule.c index 590ef2114a..c6817fe665 100644 --- a/Modules/_gdbmmodule.c +++ b/Modules/_gdbmmodule.c @@ -142,7 +142,7 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w) if (!PyArg_Parse(v, "s#", &krec.dptr, &krec.dsize) ) { PyErr_SetString(PyExc_TypeError, - "gdbm mappings have string indices only"); + "gdbm mappings have bytes or string indices only"); return -1; } if (dp->di_dbm == NULL) { @@ -160,7 +160,7 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w) else { if (!PyArg_Parse(w, "s#", &drec.dptr, &drec.dsize)) { PyErr_SetString(PyExc_TypeError, - "gdbm mappings have byte string elements only"); + "gdbm mappings have byte or string elements only"); return -1; } errno = 0; -- cgit v1.2.1