When key is None, give up if _DB_get_type() returns -1 as well.
This commit is contained in:
parent
024f2de05f
commit
8974f72b81
@ -350,6 +350,8 @@ make_key_dbt(DBObject* self, PyObject* keyobj, DBT* key, int* pflags)
|
|||||||
CLEAR_DBT(*key);
|
CLEAR_DBT(*key);
|
||||||
if (keyobj == Py_None) { /* TODO: is None really okay for keys? */
|
if (keyobj == Py_None) { /* TODO: is None really okay for keys? */
|
||||||
type = _DB_get_type(self);
|
type = _DB_get_type(self);
|
||||||
|
if (type == -1)
|
||||||
|
return 0;
|
||||||
if (type == DB_RECNO || type == DB_QUEUE) {
|
if (type == DB_RECNO || type == DB_QUEUE) {
|
||||||
PyErr_SetString(
|
PyErr_SetString(
|
||||||
PyExc_TypeError,
|
PyExc_TypeError,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user