[Python-checkins] python/dist/src/Modules _bsddb.c,1.1,1.2

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 23 Nov 2002 03:26:10 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv21585/Modules

Modified Files:
	_bsddb.c 
Log Message:
Merge with bsddb3 2002.11.23.10.42.36


Index: _bsddb.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** _bsddb.c	19 Nov 2002 08:09:52 -0000	1.1
--- _bsddb.c	23 Nov 2002 11:26:07 -0000	1.2
***************
*** 76,85 ****
  /* Various macro definitions */
  
! #define PY_BSDDB_VERSION "3.4.0"
  
  /* 40 = 4.0, 33 = 3.3; this will break if the second number is > 9 */
  #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
  
! static char *orig_rcs_id = "/Id: _db.c,v 1.44 2002/06/07 18:24:00 greg Exp /";
  static char *rcs_id = "$Id$";
  
--- 76,85 ----
  /* Various macro definitions */
  
! #define PY_BSDDB_VERSION "3.4.2"
  
  /* 40 = 4.0, 33 = 3.3; this will break if the second number is > 9 */
  #define DBVER (DB_VERSION_MAJOR * 10 + DB_VERSION_MINOR)
  
! static char *orig_rcs_id = "/Id: _db.c,v 1.48 2002/11/21 19:11:19 greg Exp /";
  static char *rcs_id = "$Id$";
  
***************
*** 1013,1017 ****
      secondaryDB->primaryDBType = _DB_get_type(self);
  
! 
      MYDB_BEGIN_ALLOW_THREADS;
      err = self->db->associate(self->db,
--- 1013,1027 ----
      secondaryDB->primaryDBType = _DB_get_type(self);
  
!     /* PyEval_InitThreads is called here due to a quirk in python 1.5
!      * - 2.2.1 (at least) according to Russell Williamson <merel@wt.net>:
!      * The global interepreter lock is not initialized until the first
!      * thread is created using thread.start_new_thread() or fork() is
!      * called.  that would cause the ALLOW_THREADS here to segfault due
!      * to a null pointer reference if no threads or child processes
!      * have been created.  This works around that and is a no-op if
!      * threads have already been initialized.
!      *  (see pybsddb-users mailing list post on 2002-08-07)
!      */
!     PyEval_InitThreads();
      MYDB_BEGIN_ALLOW_THREADS;
      err = self->db->associate(self->db,
***************
*** 2324,2329 ****
          return NULL;
  
-     CHECK_CURSOR_NOT_CLOSED(self);
- 
      if (self->dbc != NULL) {
          MYDB_BEGIN_ALLOW_THREADS;
--- 2334,2337 ----
***************
*** 2414,2418 ****
  DBC_get(DBCursorObject* self, PyObject* args, PyObject *kwargs)
  {
!     int err, flags;
      PyObject* keyobj = NULL;
      PyObject* dataobj = NULL;
--- 2422,2426 ----
  DBC_get(DBCursorObject* self, PyObject* args, PyObject *kwargs)
  {
!     int err, flags=0;
      PyObject* keyobj = NULL;
      PyObject* dataobj = NULL;
***************
*** 3299,3303 ****
      DB_LOCK_STAT* sp;
      PyObject* d = NULL;
!     u_int32_t flags;
  
      if (!PyArg_ParseTuple(args, "|i:lock_stat", &flags))
--- 3307,3311 ----
      DB_LOCK_STAT* sp;
      PyObject* d = NULL;
!     u_int32_t flags = 0;
  
      if (!PyArg_ParseTuple(args, "|i:lock_stat", &flags))
***************
*** 3411,3415 ****
      DB_TXN_STAT* sp;
      PyObject* d = NULL;
!     u_int32_t flags;
  
      if (!PyArg_ParseTuple(args, "|i:txn_stat", &flags))
--- 3419,3423 ----
      DB_TXN_STAT* sp;
      PyObject* d = NULL;
!     u_int32_t flags=0;
  
      if (!PyArg_ParseTuple(args, "|i:txn_stat", &flags))