summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2004-01-20 15:20:03 (GMT)
committerGustavo Niemeyer <gustavo@niemeyer.net>2004-01-20 15:20:03 (GMT)
commit8974f72b81229a39f130cb6f1528b5774412f74e (patch)
treeaa505aaa347ced1193ab90d716fdf90c2915526b
parent024f2de05f1dc5b8573f98426aa11bb9b07cc55e (diff)
downloadcpython-8974f72b81229a39f130cb6f1528b5774412f74e.zip
cpython-8974f72b81229a39f130cb6f1528b5774412f74e.tar.gz
cpython-8974f72b81229a39f130cb6f1528b5774412f74e.tar.bz2
When key is None, give up if _DB_get_type() returns -1 as well.
-rw-r--r--Modules/_bsddb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c
index ba6af27..b9259d6 100644
--- a/Modules/_bsddb.c
+++ b/Modules/_bsddb.c
@@ -350,6 +350,8 @@ make_key_dbt(DBObject* self, PyObject* keyobj, DBT* key, int* pflags)
CLEAR_DBT(*key);
if (keyobj == Py_None) { /* TODO: is None really okay for keys? */
type = _DB_get_type(self);
+ if (type == -1)
+ return 0;
if (type == DB_RECNO || type == DB_QUEUE) {
PyErr_SetString(
PyExc_TypeError,