Index: third_party/jinja2/_compat.py |
diff --git a/third_party/jinja2/_compat.py b/third_party/jinja2/_compat.py |
index 8fa8a49a0a22c22d3b58e23daacca4a163c365c8..143962f384fa89add98f8a1ac181bd418afdad9f 100644 |
--- a/third_party/jinja2/_compat.py |
+++ b/third_party/jinja2/_compat.py |
@@ -22,6 +22,7 @@ if not PY2: |
range_type = range |
text_type = str |
string_types = (str,) |
+ integer_types = (int,) |
iterkeys = lambda d: iter(d.keys()) |
itervalues = lambda d: iter(d.values()) |
@@ -51,6 +52,7 @@ else: |
text_type = unicode |
range_type = xrange |
string_types = (str, unicode) |
+ integer_types = (int, long) |
iterkeys = lambda d: d.iterkeys() |
itervalues = lambda d: d.itervalues() |
@@ -82,12 +84,6 @@ else: |
return filename.encode('utf-8') |
return filename |
-try: |
- next = next |
-except NameError: |
- def next(it): |
- return it.next() |
- |
def with_metaclass(meta, *bases): |
# This requires a bit of explanation: the basic idea is to make a |
@@ -110,41 +106,6 @@ def with_metaclass(meta, *bases): |
try: |
- from collections import Mapping as mapping_types |
-except ImportError: |
- import UserDict |
- mapping_types = (UserDict.UserDict, UserDict.DictMixin, dict) |
- |
- |
-# common types. These do exist in the special types module too which however |
-# does not exist in IronPython out of the box. Also that way we don't have |
-# to deal with implementation specific stuff here |
-class _C(object): |
- def method(self): pass |
-def _func(): |
- yield None |
-function_type = type(_func) |
-generator_type = type(_func()) |
-method_type = type(_C().method) |
-code_type = type(_C.method.__code__) |
-try: |
- raise TypeError() |
-except TypeError: |
- _tb = sys.exc_info()[2] |
- traceback_type = type(_tb) |
- frame_type = type(_tb.tb_frame) |
- |
- |
-try: |
from urllib.parse import quote_from_bytes as url_quote |
except ImportError: |
from urllib import quote as url_quote |
- |
- |
-try: |
- from thread import allocate_lock |
-except ImportError: |
- try: |
- from threading import Lock as allocate_lock |
- except ImportError: |
- from dummy_thread import allocate_lock |