Commit 58605592 authored by Andreas Jung's avatar Andreas Jung

Fixed broken conflict resolution

_p_resolveConflict could not handle tuples from getstate()
properly
parent b26a02e9
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
****************************************************************************/ ****************************************************************************/
#define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.17 2001/06/20 14:48:51 matt Exp $\n" #define BTREETEMPLATE_C "$Id: BTreeTemplate.c,v 1.18 2001/08/13 19:03:10 andreasjung Exp $\n"
/* /*
** _BTree_get ** _BTree_get
...@@ -845,13 +845,15 @@ BTree__p_resolveConflict(BTree *self, PyObject *args) ...@@ -845,13 +845,15 @@ BTree__p_resolveConflict(BTree *self, PyObject *args)
PyObject *s[3], *r; PyObject *s[3], *r;
int i; int i;
UNLESS (PyArg_ParseTuple(args, "OOO", s, s+1, s+2)) return NULL; r = NULL;
UNLESS (PyArg_ParseTuple(args, "OOO", s, s+1, s+2)) goto err;
/* for each state, detuplefy it twice */ /* for each state, detuplefy it twice */
for (i=0; i < 3; i++) for (i=0; i < 3; i++)
UNLESS (s[i]==Py_None || PyArg_ParseTuple(s[i], "O", s+i)) return NULL; UNLESS (s[i]==Py_None || PyArg_ParseTuple(s[i], "O", s+i)) goto err;
for (i=0; i < 3; i++) for (i=0; i < 3; i++)
UNLESS (s[i]==Py_None || PyArg_ParseTuple(s[i], "O", s+i)) return NULL; UNLESS (s[i]==Py_None || PyArg_ParseTuple(s[i], "O", s+i)) goto err;
for (i=0; i < 3; i++) /* Now make sure detupled thing is a tuple */ for (i=0; i < 3; i++) /* Now make sure detupled thing is a tuple */
UNLESS (s[i]==Py_None || PyTuple_Check(s[i])) UNLESS (s[i]==Py_None || PyTuple_Check(s[i]))
...@@ -862,6 +864,8 @@ BTree__p_resolveConflict(BTree *self, PyObject *args) ...@@ -862,6 +864,8 @@ BTree__p_resolveConflict(BTree *self, PyObject *args)
else else
r = _bucket__p_resolveConflict(OBJECT(&SetType), s); r = _bucket__p_resolveConflict(OBJECT(&SetType), s);
err:
if (r) { if (r) {
ASSIGN(r, Py_BuildValue("((O))", r)); ASSIGN(r, Py_BuildValue("((O))", r));
} else { } else {
......
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