[Zodb-checkins] CVS: Zope3/lib/python/Persistence/BTrees - BTreeTemplate.c:1.1.2.19 BucketTemplate.c:1.1.2.18
Jeremy Hylton
jeremy@zope.com
Thu, 6 Jun 2002 14:26:08 -0400
Update of /cvs-repository/Zope3/lib/python/Persistence/BTrees
In directory cvs.zope.org:/tmp/cvs-serv20858/BTrees
Modified Files:
Tag: Zope-3x-branch
BTreeTemplate.c BucketTemplate.c
Log Message:
Fix invocation of _p_deactivate().
The old version of the code was always calling the base persistence
_p_deactivate() -- spelled persist_deactivate in C. If type or class
had a customize _p_deactivate() it was ignored. Errors that occurred
during the call where also ignored.
Fix the cPersistence machinery to lookup _p_deactivate() on the
object. XXX Should we try to optimize this newly slower code?
Make sure the BTrees _p_deactivate() methods are defined using
METH_NOARGS and are formatted consistently.
=== Zope3/lib/python/Persistence/BTrees/BTreeTemplate.c 1.1.2.18 => 1.1.2.19 ===
BTree__p_deactivate(BTree *self)
{
- if (self->po_state == UPTODATE && self->po_dm)
- {
- if (_BTree_clear(self) < 0) return NULL;
- self->po_state = GHOST;
+ if (self->po_state == UPTODATE && self->po_dm) {
+ if (_BTree_clear(self) < 0)
+ return NULL;
+ self->po_state = GHOST;
}
- Py_INCREF(Py_None);
- return Py_None;
+ Py_INCREF(Py_None);
+ return Py_None;
}
#endif
=== Zope3/lib/python/Persistence/BTrees/BucketTemplate.c 1.1.2.17 => 1.1.2.18 ===
#ifdef PERSISTENT
static PyObject *
-bucket__p_deactivate(Bucket *self, PyObject *args)
+bucket__p_deactivate(Bucket *self)
{
if (self->po_state == UPTODATE && self->po_dm) {
if (_bucket_clear(self) < 0)
@@ -1153,7 +1153,7 @@
#ifdef PERSISTENT
{"_p_resolveConflict", (PyCFunction) bucket__p_resolveConflict, METH_VARARGS,
"_p_resolveConflict() -- Reinitialize from a newly created copy"},
- {"_p_deactivate", (PyCFunction) bucket__p_deactivate, METH_VARARGS,
+ {"_p_deactivate", (PyCFunction) bucket__p_deactivate, METH_NOARGS,
"_p_deactivate() -- Reinitialize from a newly created copy"},
#endif
{NULL, NULL} /* sentinel */