diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-26 05:19:56 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-01-26 05:19:56 (GMT) |
commit | cd8a8c3586c410600eb008a1437243f784054627 (patch) | |
tree | 3101b71643ec86f8237a33c3a672c4622c8adfc0 | |
parent | 4f702c49bc4bf04d41daa396b3f329c73231d4f6 (diff) | |
download | cpython-cd8a8c3586c410600eb008a1437243f784054627.zip cpython-cd8a8c3586c410600eb008a1437243f784054627.tar.gz cpython-cd8a8c3586c410600eb008a1437243f784054627.tar.bz2 |
Backport 42173: get bsddb test_associate to pass with BSDDB 4.1
-rw-r--r-- | Modules/_bsddb.c | 4 |
1 files 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); |