diff options
author | Gustavo Niemeyer <gustavo@niemeyer.net> | 2004-01-20 15:20:03 (GMT) |
---|---|---|
committer | Gustavo Niemeyer <gustavo@niemeyer.net> | 2004-01-20 15:20:03 (GMT) |
commit | 8974f72b81229a39f130cb6f1528b5774412f74e (patch) | |
tree | aa505aaa347ced1193ab90d716fdf90c2915526b /Modules | |
parent | 024f2de05f1dc5b8573f98426aa11bb9b07cc55e (diff) | |
download | cpython-8974f72b81229a39f130cb6f1528b5774412f74e.zip cpython-8974f72b81229a39f130cb6f1528b5774412f74e.tar.gz cpython-8974f72b81229a39f130cb6f1528b5774412f74e.tar.bz2 |
When key is None, give up if _DB_get_type() returns -1 as well.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_bsddb.c | 2 |
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, |