[Zodb-checkins] CVS: StandaloneZODB/ZODB - cPersistence.c:1.45 cPickleCache.c:1.35
Jeremy Hylton
jeremy@zope.com
Tue, 6 Nov 2001 14:37:00 -0500
Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv10851/ZODB
Modified Files:
cPersistence.c cPickleCache.c
Log Message:
Remove use of Python-2.2-specific C API routine PyObject_Call()
=== StandaloneZODB/ZODB/cPersistence.c 1.44 => 1.45 ===
callmethod1(PyObject *self, PyObject *name, PyObject *arg)
{
- if((self=PyObject_GetAttr(self,name)) && (name=PyTuple_New(1)))
+ self = PyObject_GetAttr(self, name);
+ UNLESS(self) return NULL;
+ name = PyTuple_New(1);
+ UNLESS(name)
{
- PyTuple_SET_ITEM(name, 0, arg);
- ASSIGN(self,PyObject_CallObject(self,name));
- PyTuple_SET_ITEM(name, 0, NULL);
- Py_DECREF(name);
+ Py_DECREF(self);
+ return NULL;
}
+ PyTuple_SET_ITEM(name, 0, arg);
+ ASSIGN(self, PyObject_CallObject(self, name));
+ PyTuple_SET_ITEM(name, 0, NULL);
+ Py_DECREF(name);
return self;
}
@@ -359,7 +364,7 @@
{
UNLESS_ASSIGN(key,PySequence_GetItem(keys,i)) goto err;
UNLESS_ASSIGN(e,PyObject_GetItem(v,key)) goto err;
- UNLESS(-1 != PyObject_SetItem(__dict__,key,e)) goto err;
+ UNLESS(-1 != PyDict_SetItem(__dict__,key,e)) goto err;
}
Py_XDECREF(key);
=== StandaloneZODB/ZODB/cPickleCache.c 1.34 => 1.35 ===
{
PyTuple_SET_ITEM(t, 0, v);
- v = PyObject_Call(self->setklassstate, t, NULL);
+ v = PyObject_CallObject(self->setklassstate, t);
PyTuple_SET_ITEM(t, 0, NULL);
Py_DECREF(t);
}