[Checkins] SVN: Products.ZCatalog/trunk/ Fix possible TypeError in `sortResults` method if only b_start but not b_size has been provided.

Hanno Schlichting hannosch at hannosch.eu
Wed Apr 27 08:04:50 EDT 2011


Log message for revision 121473:
  Fix possible TypeError in `sortResults` method if only b_start but not b_size has been provided.
  

Changed:
  U   Products.ZCatalog/trunk/CHANGES.txt
  U   Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py

-=-
Modified: Products.ZCatalog/trunk/CHANGES.txt
===================================================================
--- Products.ZCatalog/trunk/CHANGES.txt	2011-04-27 09:28:17 UTC (rev 121472)
+++ Products.ZCatalog/trunk/CHANGES.txt	2011-04-27 12:04:49 UTC (rev 121473)
@@ -4,6 +4,9 @@
 2.13.11 (unreleased)
 --------------------
 
+- Fix possible TypeError in `sortResults` method if only b_start but not b_size
+  has been provided.
+
 - Prevent the new UUIDIndex from acquiring attributes via Acquisition.
 
 2.13.10 (2011-04-21)

Modified: Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py
===================================================================
--- Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-04-27 09:28:17 UTC (rev 121472)
+++ Products.ZCatalog/trunk/src/Products/ZCatalog/Catalog.py	2011-04-27 12:04:49 UTC (rev 121473)
@@ -700,7 +700,7 @@
         # if we want a batch from the end of the resultset, reverse sorting
         # order and limit it, then reverse the resultset again
         switched_reverse = False
-        if b_start and b_start > rlen / 2:
+        if b_size and b_start and b_start > rlen / 2:
             reverse = not reverse
             switched_reverse = True
             b_end = b_start + b_size



More information about the checkins mailing list