[Zodb-checkins] CVS: ZODB3/BTrees - BTreeTemplate.c:1.74.10.5 BucketTemplate.c:1.54.6.4

Tim Peters tim.one at comcast.net
Tue Jul 8 16:03:45 EDT 2003


Update of /cvs-repository/ZODB3/BTrees
In directory cvs.zope.org:/tmp/cvs-serv4287/BTrees

Modified Files:
      Tag: zodb33-devel-branch
	BTreeTemplate.c BucketTemplate.c 
Log Message:
Bucket and BTree tp_clear slots:  don't call the base class tp_clear
slot unless it has one.


=== ZODB3/BTrees/BTreeTemplate.c 1.74.10.4 => 1.74.10.5 ===
--- ZODB3/BTrees/BTreeTemplate.c:1.74.10.4	Mon Jul  7 16:07:20 2003
+++ ZODB3/BTrees/BTreeTemplate.c	Tue Jul  8 15:03:37 2003
@@ -1967,11 +1967,10 @@
 static int
 BTree_tp_clear(BTree *self)
 {
-    /* Call our base type's clear function.  Because BTrees are
-     * subclasses of Peristent, there must be one.
-     */
-    assert(self->ob_type->tp_base->tp_clear);
-    self->ob_type->tp_base->tp_clear((PyObject *)self);
+    /* Call our base type's clear function, if any. */
+    if (self->ob_type->tp_base->tp_clear)
+	self->ob_type->tp_base->tp_clear((PyObject *)self);
+
     if (self->state != cPersistent_GHOST_STATE)
 	_BTree_clear(self);
     return 0;


=== ZODB3/BTrees/BucketTemplate.c 1.54.6.3 => 1.54.6.4 ===
--- ZODB3/BTrees/BucketTemplate.c:1.54.6.3	Mon Jul  7 16:04:14 2003
+++ ZODB3/BTrees/BucketTemplate.c	Tue Jul  8 15:03:37 2003
@@ -1582,11 +1582,9 @@
 int
 bucket_tp_clear(Bucket *self)
 {
-    /* Call our base type's clear function.  Because buckets are
-     * subclasses of Peristent, there must be one.
-     */
-    assert(self->ob_type->tp_base->tp_clear);
-    self->ob_type->tp_base->tp_clear((PyObject *)self);
+    /* Call our base type's clear function, if any. */
+    if (self->ob_type->tp_base->tp_clear)
+	self->ob_type->tp_base->tp_clear((PyObject *)self);
 
     if (self->state != cPersistent_GHOST_STATE)
 	_bucket_clear(self);




More information about the Zodb-checkins mailing list