From: Guido van Rossum Date: Fri, 24 Aug 2007 05:08:58 +0000 (+0000) Subject: Fix logic bug that triggered assert. X-Git-Tag: v3.0a1~299 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fc5fafcf78c87ff80b79a9b89cee7b0e2add6186;p=thirdparty%2FPython%2Fcpython.git Fix logic bug that triggered assert. --- diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 389b1036b321..50568e7e66ec 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -379,8 +379,9 @@ static int make_dbt(PyObject* obj, DBT* dbt) CLEAR_DBT(*dbt); if (obj == Py_None) { /* no need to do anything, the structure has already been zeroed */ + return 1; } - else if (!PyBytes_Check(obj)) { + if (!PyBytes_Check(obj)) { PyErr_SetString(PyExc_TypeError, "Data values must be of type bytes or None."); return 0;