[selectors] make multi_columns_rset work with a simple list of lists stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 May 2012 10:33:42 +0200
branchstable
changeset 8395 41729460d8c3
parent 8380 b752df3e8596
child 8397 42ec34b3ced9
child 8398 a9fe30c953be
[selectors] make multi_columns_rset work with a simple list of lists
selectors.py
--- a/selectors.py	Wed May 02 10:12:02 2012 +0200
+++ b/selectors.py	Thu May 10 10:33:42 2012 +0200
@@ -641,8 +641,9 @@
 
     @lltrace
     def __call__(self, cls, req, rset=None, **kwargs):
-        # 'or 0' since we *must not* return None
-        return rset and self.match_expected(len(rset.rows[0])) or 0
+        # 'or 0' since we *must not* return None. Also don't use rset.rows so
+        # this selector will work if rset is a simple list of list.
+        return rset and self.match_expected(len(rset[0])) or 0
 
 
 class paginated_rset(Selector):