]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix logic bug that triggered assert.
authorGuido van Rossum <guido@python.org>
Fri, 24 Aug 2007 05:08:58 +0000 (05:08 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 24 Aug 2007 05:08:58 +0000 (05:08 +0000)
Modules/_bsddb.c

index 389b1036b32117163e16319b1b5583ad545481af..50568e7e66eca3c6e825e0f71f16fe7f1e0a86ce 100644 (file)
@@ -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;