From: Armin Ronacher Date: Thu, 18 Oct 2007 20:33:45 +0000 (+0200) Subject: iteration over old style class that have no length should work now X-Git-Tag: 2.0rc1~262 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ee309516709816c3122844bc502255f0a596e60;p=thirdparty%2Fjinja.git iteration over old style class that have no length should work now --HG-- branch : trunk --- diff --git a/jinja/datastructure.py b/jinja/datastructure.py index f4887b3d..d265d8d1 100644 --- a/jinja/datastructure.py +++ b/jinja/datastructure.py @@ -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({