backport stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 May 2012 10:37:28 +0200
changeset 8397 42ec34b3ced9
parent 8396 8d58fcf68539 (current diff)
parent 8395 41729460d8c3 (diff)
child 8399 0ea4ccf1d9a6
backport stable
predicates.py
selectors.py
--- a/predicates.py	Thu May 10 10:31:53 2012 +0200
+++ b/predicates.py	Thu May 10 10:37:28 2012 +0200
@@ -618,8 +618,9 @@
     """
 
     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(Predicate):