Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8974f72

Browse files
committed
When key is None, give up if _DB_get_type() returns -1 as well.
1 parent 024f2de commit 8974f72

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Modules/_bsddb.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ make_key_dbt(DBObject* self, PyObject* keyobj, DBT* key, int* pflags)
350350
CLEAR_DBT(*key);
351351
if (keyobj == Py_None) { /* TODO: is None really okay for keys? */
352352
type = _DB_get_type(self);
353+
if (type == -1)
354+
return 0;
353355
if (type == DB_RECNO || type == DB_QUEUE) {
354356
PyErr_SetString(
355357
PyExc_TypeError,

0 commit comments

Comments
 (0)