[Zope-Checkins] CVS: Zope/lib/python/BTrees - BTreeTemplate.c:1.18

Andreas Jung andreas@zope.com
Mon, 13 Aug 2001 15:03:10 -0400


Update of /cvs-repository/Zope/lib/python/BTrees
In directory cvs.zope.org:/tmp/cvs-serv22745

Modified Files:
	BTreeTemplate.c 
Log Message:
Fixed broken conflict resolution
_p_resolveConflict could not handle tuples from getstate()
properly


=== Zope/lib/python/BTrees/BTreeTemplate.c 1.17 => 1.18 ===
   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 (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++)
-    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 */
     UNLESS (s[i]==Py_None || PyTuple_Check(s[i]))
@@ -861,6 +863,8 @@
       r = _bucket__p_resolveConflict(OBJECT(&BucketType), s);
   else
       r = _bucket__p_resolveConflict(OBJECT(&SetType), s);
+
+err:
 
   if (r) {
   	ASSIGN(r, Py_BuildValue("((O))", r));