Commit 5e8ef960 authored by matt@zope.com's avatar matt@zope.com

Fix result return from ConflictError trap

parent bc697029
......@@ -341,7 +341,7 @@ static char BTree_module_documentation[] =
"\n"
MASTER_ID
BTREEITEMSTEMPLATE_C
"$Id: BTreeModuleTemplate.c,v 1.12 2001/06/20 14:48:51 matt Exp $\n"
"$Id: BTreeModuleTemplate.c,v 1.13 2001/06/20 19:32:55 matt Exp $\n"
BTREETEMPLATE_C
BUCKETTEMPLATE_C
KEYMACROS_H
......@@ -395,19 +395,19 @@ INITMODULE (void)
c = PyObject_GetAttrString(m,"ConflictError");
if (c != NULL)
ConflictError = c;
else
ConflictError = PyExc_ValueError;
Py_DECREF(m);
} else ConflictError = PyExc_ValueError;
}
if (ConflictError == NULL) {
Py_INCREF(PyExc_ValueError);
ConflictError=PyExc_ValueError;
}
#else
BTreeType.tp_getattro=PyExtensionClassCAPI->getattro;
BucketType.tp_getattro=PyExtensionClassCAPI->getattro;
SetType.tp_getattro=PyExtensionClassCAPI->getattro;
TreeSetType.tp_getattro=PyExtensionClassCAPI->getattro;
ConflictError = PyExc_ValueError; /* MergeTemplate checks anyway */
#endif
BTreeItemsType.ob_type=&PyType_Type;
......@@ -427,7 +427,7 @@ INITMODULE (void)
d = PyModule_GetDict(m);
PyDict_SetItemString(d, "__version__",
PyString_FromString("$Revision: 1.12 $"));
PyString_FromString("$Revision: 1.13 $"));
PyExtensionClass_Export(d,MOD_NAME_PREFIX "Bucket", BucketType);
PyExtensionClass_Export(d,MOD_NAME_PREFIX "BTree", BTreeType);
......
......@@ -82,7 +82,7 @@
****************************************************************************/
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.15 2001/06/20 14:48:51 matt Exp $\n"
#define BUCKETTEMPLATE_C "$Id: BucketTemplate.c,v 1.16 2001/06/20 19:32:55 matt Exp $\n"
/*
** _bucket_get
......@@ -1137,6 +1137,8 @@ bucket__p_resolveConflict(Bucket *self, PyObject *args)
Py_XDECREF(error);
PyErr_Restore(ConflictError, value, traceback);
}
return result;
}
#endif
......
......@@ -83,7 +83,7 @@
****************************************************************************/
#define MERGETEMPLATE_C "$Id: MergeTemplate.c,v 1.6 2001/06/20 14:48:51 matt Exp $\n"
#define MERGETEMPLATE_C "$Id: MergeTemplate.c,v 1.7 2001/06/20 19:32:55 matt Exp $\n"
/****************************************************************************
Set operations
......@@ -110,7 +110,10 @@ merge_error(int p1, int p2, int p3, int reason)
PyObject *r;
UNLESS (r=Py_BuildValue("iiii", p1, p2, p3, reason)) r=Py_None;
if (ConflictError == NULL) ConflictError=PyExc_ValueError;
if (ConflictError == NULL) {
ConflictError=PyExc_ValueError;
Py_INCREF(ConflictError);
}
PyErr_SetObject(ConflictError, r);
if (r != Py_None)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment