From cd8a8c3586c410600eb008a1437243f784054627 Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Thu, 26 Jan 2006 05:19:56 +0000 Subject: Backport 42173: get bsddb test_associate to pass with BSDDB 4.1 --- Modules/_bsddb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index c6efa1c..07c56cd 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -906,7 +906,7 @@ DBEnv_dealloc(DBEnvObject* self) } #endif - if (self->db_env) { + if (self->db_env && !self->closed) { MYDB_BEGIN_ALLOW_THREADS; self->db_env->close(self->db_env, 0); MYDB_END_ALLOW_THREADS; @@ -2996,7 +2996,7 @@ DBC_pget(DBCursorObject* self, PyObject* args, PyObject *kwargs) else pkeyObj = PyString_FromStringAndSize(pkey.data, pkey.size); - if (flags & DB_SET_RECNO) /* return key, pkey and data */ + if (key.data && key.size) /* return key, pkey and data */ { PyObject *keyObj; int type = _DB_get_type(self->mydb); -- cgit v0.12