Different name for builtins in Python 3
authorArmin Ronacher <armin.ronacher@active-4.com>
Tue, 20 Apr 2010 17:48:46 +0000 (19:48 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Tue, 20 Apr 2010 17:48:46 +0000 (19:48 +0200)
--HG--
branch : trunk

jinja2/utils.py

index 8bf2c7f6883cd2439116bb2edc935cdb8e4361a0..0db4653e9f8208136b819ef14548b97b7557c42d 100644 (file)
@@ -236,7 +236,8 @@ def object_type_repr(obj):
         return 'None'
     elif obj is Ellipsis:
         return 'Ellipsis'
-    if obj.__class__.__module__ == '__builtin__':
+    # __builtin__ in 2.x, builtins in 3.x
+    if obj.__class__.__module__ in ('__builtin__', 'builtins'):
         name = obj.__class__.__name__
     else:
         name = obj.__class__.__module__ + '.' + obj.__class__.__name__