[Python-checkins] r42187 - python/branches/release24-maint/Modules/_bsddb.c

neal.norwitz python-checkins at python.org
Thu Jan 26 06:19:57 CET 2006


Author: neal.norwitz
Date: Thu Jan 26 06:19:56 2006
New Revision: 42187

Modified:
   python/branches/release24-maint/Modules/_bsddb.c
Log:
Backport 42173: get bsddb test_associate to pass with BSDDB 4.1

Modified: python/branches/release24-maint/Modules/_bsddb.c
==============================================================================
--- python/branches/release24-maint/Modules/_bsddb.c	(original)
+++ python/branches/release24-maint/Modules/_bsddb.c	Thu Jan 26 06:19:56 2006
@@ -906,7 +906,7 @@
     }
 #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 @@
         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);


More information about the Python-checkins mailing list