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

Skip to content

Commit fc5fafc

Browse files
committed
Fix logic bug that triggered assert.
1 parent 37410aa commit fc5fafc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/_bsddb.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,8 +379,9 @@ static int make_dbt(PyObject* obj, DBT* dbt)
379379
CLEAR_DBT(*dbt);
380380
if (obj == Py_None) {
381381
/* no need to do anything, the structure has already been zeroed */
382+
return 1;
382383
}
383-
else if (!PyBytes_Check(obj)) {
384+
if (!PyBytes_Check(obj)) {
384385
PyErr_SetString(PyExc_TypeError,
385386
"Data values must be of type bytes or None.");
386387
return 0;

0 commit comments

Comments
 (0)