[Zope-Checkins] CVS: Zope/lib/python/BTrees - BucketTemplate.c:1.21.2.1

Andreas Jung andreas@zope.com
Fri, 21 Dec 2001 11:08:05 -0500


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

Modified Files:
      Tag: Zope-2_5-branch
	BucketTemplate.c 
Log Message:

      - Collector #99: items(), keys() and values() methods
        of IIBucket objects has been broken when called with
        min/max parameters.


=== Zope/lib/python/BTrees/BucketTemplate.c 1.21 => 1.21.2.1 ===
     {
       COPY_KEY_TO_OBJECT(key, self->keys[i]);
-      if (PyList_SetItem(r, i, key) < 0) goto err;
+      if (PyList_SetItem(r, i-low , key) < 0) goto err;
     }
 
   PER_ALLOW_DEACTIVATION(self);
@@ -633,7 +633,7 @@
     {
       COPY_VALUE_TO_OBJECT(v, self->values[i]);
       UNLESS (v) goto err;
-      if (PyList_SetItem(r, i, v) < 0) goto err;
+      if (PyList_SetItem(r, i-low, v) < 0) goto err;
     }
 
   PER_ALLOW_DEACTIVATION(self);
@@ -681,7 +681,7 @@
       UNLESS (o) goto err;
       PyTuple_SET_ITEM(item, 1, o);
       
-      if (PyList_SetItem(r, i, item) < 0) goto err;
+      if (PyList_SetItem(r, i-low, item) < 0) goto err;
 
       item = 0;
     }