iteration over old style class that have no length should work now
authorArmin Ronacher <armin.ronacher@active-4.com>
Thu, 18 Oct 2007 20:33:45 +0000 (22:33 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Thu, 18 Oct 2007 20:33:45 +0000 (22:33 +0200)
--HG--
branch : trunk

jinja/datastructure.py

index f4887b3de72435635fe3b9e40c7a650a8bb4aa5e..d265d8d1054fa2672dc57c29227040c24905c548 100644 (file)
@@ -345,7 +345,7 @@ class LoopContext(object):
         else:
             try:
                 length = len(seq)
-            except TypeError:
+            except (AttributeError, TypeError):
                 seq = list(seq)
                 length = len(seq)
         self._stack.append({