diff options
author | Guido van Rossum <guido@python.org> | 2007-08-24 05:08:58 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-24 05:08:58 (GMT) |
commit | fc5fafcf78c87ff80b79a9b89cee7b0e2add6186 (patch) | |
tree | e56a1423c88f73bbbcd125aca1445451a5531cdd /Modules | |
parent | 37410aa044fd4ac665a8a8d8031bd0e165515a8e (diff) | |
download | cpython-fc5fafcf78c87ff80b79a9b89cee7b0e2add6186.zip cpython-fc5fafcf78c87ff80b79a9b89cee7b0e2add6186.tar.gz cpython-fc5fafcf78c87ff80b79a9b89cee7b0e2add6186.tar.bz2 |
Fix logic bug that triggered assert.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_bsddb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index 389b103..50568e7 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; |