From 802f4720cd854c22f300b883d52967a8ccf2a2cb Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Tue, 20 Apr 2010 19:48:46 +0200 Subject: [PATCH] Different name for builtins in Python 3 --HG-- branch : trunk --- jinja2/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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__ -- 2.26.2