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

Unified Diff: third_party/jinja2/meta.py

Issue 23506004: Update Jinja2 (Python template library) to 2.7.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 4 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/loaders.py ('k') | third_party/jinja2/nodes.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/jinja2/meta.py
diff --git a/third_party/jinja2/meta.py b/third_party/jinja2/meta.py
index 3a779a5e9a81a6b59b0fa1685c63e62e38a70b9c..3110cff6066a0160df1b01c63b117afd60245288 100644
--- a/third_party/jinja2/meta.py
+++ b/third_party/jinja2/meta.py
@@ -11,6 +11,7 @@
"""
from jinja2 import nodes
from jinja2.compiler import CodeGenerator
+from jinja2._compat import string_types
class TrackingCodeGenerator(CodeGenerator):
@@ -77,7 +78,7 @@ def find_referenced_templates(ast):
# something const, only yield the strings and ignore
# non-string consts that really just make no sense
if isinstance(template_name, nodes.Const):
- if isinstance(template_name.value, basestring):
+ if isinstance(template_name.value, string_types):
yield template_name.value
# something dynamic in there
else:
@@ -87,7 +88,7 @@ def find_referenced_templates(ast):
yield None
continue
# constant is a basestring, direct template name
- if isinstance(node.template.value, basestring):
+ if isinstance(node.template.value, string_types):
yield node.template.value
# a tuple or list (latter *should* not happen) made of consts,
# yield the consts that are strings. We could warn here for
@@ -95,7 +96,7 @@ def find_referenced_templates(ast):
elif isinstance(node, nodes.Include) and \
isinstance(node.template.value, (tuple, list)):
for template_name in node.template.value:
- if isinstance(template_name, basestring):
+ if isinstance(template_name, string_types):
yield template_name
# something else we don't care about, we could warn here
else:
« no previous file with comments | « third_party/jinja2/loaders.py ('k') | third_party/jinja2/nodes.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698