From: Armin Ronacher Date: Tue, 20 Apr 2010 17:48:46 +0000 (+0200) Subject: Different name for builtins in Python 3 X-Git-Tag: 2.5~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=802f4720cd854c22f300b883d52967a8ccf2a2cb;p=jinja2.git Different name for builtins in Python 3 --HG-- branch : trunk --- diff --git a/jinja2/utils.py b/jinja2/utils.py index 8bf2c7f..0db4653 100644 --- a/jinja2/utils.py +++ b/jinja2/utils.py @@ -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__