Armin Ronacher avatar Armin Ronacher committed 800ac7f

fixed an error reporting bug for undefineds.

branch : trunk

Comments (0)

Files changed (4)

 Jinja2 Changelog
-Version 2.5
-(codename to be selected, release date to be announced)
+Version 2.4.1
+(bugfix release, released on April 20th 2010)
+- fixed an error reporting bug for undefineds.
 Version 2.4


 from jinja2 import Environment, Undefined, DebugUndefined, \
      StrictUndefined, UndefinedError, Template, meta
-from jinja2.utils import LRUCache, escape
+from jinja2.utils import LRUCache, escape, object_type_repr
 class LRUCacheTestCase(JinjaTestCase):
             assert copy._queue == cache._queue
+class HelpersTestCase(JinjaTestCase):
+    def test_object_type_repr(self):
+        class X(object):
+            pass
+        self.assert_equal(object_type_repr(42), 'int object')
+        self.assert_equal(object_type_repr([]), 'list object')
+        self.assert_equal(object_type_repr(X()),
+                         'jinja2.testsuite.utils.X object')
+        self.assert_equal(object_type_repr(None), 'None')
+        self.assert_equal(object_type_repr(Ellipsis), 'Ellipsis')
 class MarkupLeakTestCase(JinjaTestCase):
     def test_markup_leaks(self):
 def suite():
     suite = unittest.TestSuite()
+    suite.addTest(unittest.makeSuite(HelpersTestCase))
     # this test only tests the c extension
     if not hasattr(escape, 'func_code'):
     elif obj is Ellipsis:
         return 'Ellipsis'
     if obj.__class__.__module__ == '__builtin__':
-        name = obj.__name__
+        name = obj.__class__.__name__
-        name = obj.__class__.module__ + '.' + obj.__name__
+        name = obj.__class__.__module__ + '.' + obj.__class__.__name__
     return '%s object' % name
-    version='2.4',
+    version='2.4.1',
     author='Armin Ronacher',
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.