]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
When key is None, give up if _DB_get_type() returns -1 as well.
authorGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 20 Jan 2004 15:20:03 +0000 (15:20 +0000)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 20 Jan 2004 15:20:03 +0000 (15:20 +0000)
Modules/_bsddb.c

index ba6af27e868dc12c98938607c82c8826cd412553..b9259d640a9882755fd84de1fc8883ee71037de7 100644 (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,