diff options
author | Guido van Rossum <guido@python.org> | 2007-08-07 00:13:33 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-07 00:13:33 (GMT) |
commit | b942d28bf5b62e1823b91a7b3986e120ec9763bc (patch) | |
tree | c9823c2c41777df415dae6f018fb37599f7b1dba /Modules/dbmmodule.c | |
parent | 806c2469cb2e16c6cfd73de9a216933bd55c131f (diff) | |
download | cpython-b942d28bf5b62e1823b91a7b3986e120ec9763bc.zip cpython-b942d28bf5b62e1823b91a7b3986e120ec9763bc.tar.gz cpython-b942d28bf5b62e1823b91a7b3986e120ec9763bc.tar.bz2 |
Quick fixes for assert failures in dbm wrapper code.
Diffstat (limited to 'Modules/dbmmodule.c')
-rw-r--r-- | Modules/dbmmodule.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Modules/dbmmodule.c b/Modules/dbmmodule.c index ee75fd6..816251a 100644 --- a/Modules/dbmmodule.c +++ b/Modules/dbmmodule.c @@ -103,8 +103,7 @@ dbm_subscript(dbmobject *dp, register PyObject *key) check_dbmobject_open(dp); drec = dbm_fetch(dp->di_dbm, krec); if ( drec.dptr == 0 ) { - PyErr_SetString(PyExc_KeyError, - PyString_AS_STRING((PyStringObject *)key)); + PyErr_SetObject(PyExc_KeyError, key); return NULL; } if ( dbm_error(dp->di_dbm) ) { @@ -135,8 +134,7 @@ dbm_ass_sub(dbmobject *dp, PyObject *v, PyObject *w) if (w == NULL) { if ( dbm_delete(dp->di_dbm, krec) < 0 ) { dbm_clearerr(dp->di_dbm); - PyErr_SetString(PyExc_KeyError, - PyString_AS_STRING((PyStringObject *)v)); + PyErr_SetString(PyExc_KeyError, v); return -1; } } else { |