]> git.ipfire.org Git - thirdparty/jinja.git/commitdiff
stuff missing from previous commit, thanks git
authorThomas Waldmann <tw@waldmann-edv.de>
Sat, 18 May 2013 11:14:14 +0000 (13:14 +0200)
committerThomas Waldmann <tw@waldmann-edv.de>
Sat, 18 May 2013 11:14:14 +0000 (13:14 +0200)
jinja2/_compat.py
jinja2/compiler.py

index 61619a896b628f6b54e99c9c22248f30d50d3d28..a73875743c5616c66918ac4f1421a7f8ed821bf4 100644 (file)
@@ -3,7 +3,8 @@
     jinja2._compat
     ~~~~~~~~~~~~~~
 
-    Some py2/py3 compatibility support that is not yet available in "six".
+    Some py2/py3 compatibility support that is not yet available in
+     "six" 1.3.0.
     There are bugs open for "six" for all this stuff, so we can remove it
     again from here as soon as we require a new enough "six" release.
 
index c3d84d1089030693f4ffd396287e5f12276f30b6..1b1b5a7514fe4164dc94d687e0ee77bb9fe670b8 100644 (file)
@@ -18,6 +18,7 @@ from jinja2.utils import Markup, concat, escape, is_python_keyword
 import six
 from six.moves import cStringIO as StringIO
 from six.moves import map, zip
+from six.moves import xrange
 
 
 operators = {
@@ -75,11 +76,7 @@ def has_safe_repr(value):
     """Does the node have a safe representation?"""
     if value is None or value is NotImplemented or value is Ellipsis:
         return True
-    try:
-        range_type = xrange
-    except NameError:
-        range_type = range
-    if isinstance(value, (bool, int, float, complex, range_type, Markup) + six.string_types):
+    if isinstance(value, (bool, int, float, complex, xrange, Markup) + six.string_types):
         return True
     if isinstance(value, (tuple, list, set, frozenset)):
         for item in value: