Fixed a Python 3 bug.
authorArmin Ronacher <armin.ronacher@active-4.com>
Sat, 29 May 2010 19:00:44 +0000 (21:00 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sat, 29 May 2010 19:00:44 +0000 (21:00 +0200)
--HG--
branch : trunk

jinja2/runtime.py

index 00b823e3e45dbfa0c4c5307ea6584e85e43b1b5a..98f4aec3fd800a72954d0c3900e0c4c0b74432ed 100644 (file)
@@ -528,6 +528,9 @@ class StrictUndefined(Undefined):
     __slots__ = ()
     __iter__ = __unicode__ = __str__ = __len__ = __nonzero__ = __eq__ = \
         __ne__ = Undefined._fail_with_undefined_error
+    if sys.version_info >= (3, 0):
+        __bool__ = __nonzero__
+        del __nonzero__
 
 
 # remove remaining slots attributes, after the metaclass did the magic they