When key is None, give up if _DB_get_type() returns -1 as well.

This commit is contained in:
Gustavo Niemeyer 2004-01-20 15:20:03 +00:00
parent 024f2de05f
commit 8974f72b81
1 changed files with 2 additions and 0 deletions

View File

@ -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,