[Zope-Checkins] CVS: StandaloneZODB/ZODB - cPickleCache.c:1.54
Barry Warsaw
barry@wooz.org
Thu, 4 Apr 2002 17:02:32 -0500
Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv29907
Modified Files:
cPickleCache.c
Log Message:
cc_ass_sub(): Fixed typo in type check of the key. PyErr_Format()
takes an exception object as its first argument, and the return value
should be a -1 instead of NULL (this function's signature has an int
return).
I'm surprised no one else's build caught this compiler warning.
=== StandaloneZODB/ZODB/cPickleCache.c 1.53 => 1.54 ===
{
if (!PyString_Check(key)) {
- PyErr_Format("cPickleCache key must be a string, not a %s",
+ PyErr_Format(PyExc_TypeError,
+ "cPickleCache key must be a string, not a %s",
key->ob_type->tp_name);
- return NULL;
+ return -1;
}
if (v)
return cc_add_item(self, key, v);