[Python-checkins] python/dist/src/Modules _bsddb.c,1.35,1.36
nnorwitz at users.sourceforge.net
nnorwitz at users.sourceforge.net
Sat Jul 10 01:31:01 CEST 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5334/Modules
Modified Files:
_bsddb.c
Log Message:
Cleanup support for older pythons (perhaps it should be removed?)
Index: _bsddb.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** _bsddb.c 28 Jun 2004 04:06:47 -0000 1.35
--- _bsddb.c 9 Jul 2004 23:30:57 -0000 1.36
***************
*** 202,205 ****
--- 202,211 ----
#endif
+ #if PYTHON_API_VERSION <= 1007
+ /* 1.5 compatibility */
+ #define PyObject_New PyObject_NEW
+ #define PyObject_Del PyMem_DEL
+ #endif
+
struct behaviourFlags {
/* What is the default behaviour when DB->get or DBCursor->get returns a
***************
*** 698,708 ****
int err;
- #if PYTHON_API_VERSION <= 1007
- /* 1.5 compatibility */
- self = PyObject_NEW(DBObject, &DB_Type);
- #else
self = PyObject_New(DBObject, &DB_Type);
- #endif
-
if (self == NULL)
return NULL;
--- 704,708 ----
***************
*** 789,797 ****
}
#endif
- #if PYTHON_API_VERSION <= 1007
- PyMem_DEL(self);
- #else
PyObject_Del(self);
- #endif
}
--- 789,793 ----
***************
*** 800,809 ****
newDBCursorObject(DBC* dbc, DBObject* db)
{
! DBCursorObject* self;
! #if PYTHON_API_VERSION <= 1007
! self = PyObject_NEW(DBCursorObject, &DBCursor_Type);
! #else
! self = PyObject_New(DBCursorObject, &DBCursor_Type);
! #endif
if (self == NULL)
return NULL;
--- 796,800 ----
newDBCursorObject(DBC* dbc, DBObject* db)
{
! DBCursorObject* self = PyObject_New(DBCursorObject, &DBCursor_Type);
if (self == NULL)
return NULL;
***************
*** 845,853 ****
}
Py_XDECREF( self->mydb );
- #if PYTHON_API_VERSION <= 1007
- PyMem_DEL(self);
- #else
PyObject_Del(self);
- #endif
}
--- 836,840 ----
***************
*** 857,867 ****
{
int err;
! DBEnvObject* self;
! #if PYTHON_API_VERSION <= 1007
! self = PyObject_NEW(DBEnvObject, &DBEnv_Type);
! #else
! self = PyObject_New(DBEnvObject, &DBEnv_Type);
! #endif
!
if (self == NULL)
return NULL;
--- 844,848 ----
{
int err;
! DBEnvObject* self = PyObject_New(DBEnvObject, &DBEnv_Type);
if (self == NULL)
return NULL;
***************
*** 902,910 ****
MYDB_END_ALLOW_THREADS;
}
- #if PYTHON_API_VERSION <= 1007
- PyMem_DEL(self);
- #else
PyObject_Del(self);
- #endif
}
--- 883,887 ----
***************
*** 914,924 ****
{
int err;
! DBTxnObject* self;
!
! #if PYTHON_API_VERSION <= 1007
! self = PyObject_NEW(DBTxnObject, &DBTxn_Type);
! #else
! self = PyObject_New(DBTxnObject, &DBTxn_Type);
! #endif
if (self == NULL)
return NULL;
--- 891,895 ----
{
int err;
! DBTxnObject* self = PyObject_New(DBTxnObject, &DBTxn_Type);
if (self == NULL)
return NULL;
***************
*** 968,976 ****
#endif
- #if PYTHON_API_VERSION <= 1007
- PyMem_DEL(self);
- #else
PyObject_Del(self);
- #endif
}
--- 939,943 ----
***************
*** 981,991 ****
{
int err;
! DBLockObject* self;
!
! #if PYTHON_API_VERSION <= 1007
! self = PyObject_NEW(DBLockObject, &DBLock_Type);
! #else
! self = PyObject_New(DBLockObject, &DBLock_Type);
! #endif
if (self == NULL)
return NULL;
--- 948,952 ----
{
int err;
! DBLockObject* self = PyObject_New(DBLockObject, &DBLock_Type);
if (self == NULL)
return NULL;
***************
*** 1020,1028 ****
/* TODO: is this lock held? should we release it? */
- #if PYTHON_API_VERSION <= 1007
- PyMem_DEL(self);
- #else
PyObject_Del(self);
- #endif
}
--- 981,985 ----
More information about the Python-checkins
mailing list