Permalink
Browse files

Different name for builtins in Python 3

--HG--
branch : trunk
  • Loading branch information...
mitsuhiko committed Apr 20, 2010
1 parent 2ec1d2c commit 802f4720cd854c22f300b883d52967a8ccf2a2cb
Showing with 2 additions and 1 deletion.
  1. +2 −1 jinja2/utils.py
View
@@ -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__

0 comments on commit 802f472

Please sign in to comment.