Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: third_party/jinja2/_compat.py

Issue 2316103002: binding: Updates Jinja2 from 2.7.1 to 2.8. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/jinja2/__init__.py ('k') | third_party/jinja2/bccache.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/jinja2/__init__.py ('k') | third_party/jinja2/bccache.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698