mirror of https://github.com/python/cpython
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);
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue