mirror of
https://gitee.com/openharmony/third_party_jinja2
synced 2024-11-27 01:10:36 +00:00
feature to version check for context dict methods
This commit is contained in:
parent
146c9ba170
commit
ff0b5f5836
@ -15,7 +15,7 @@ from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
|
||||
from jinja2.exceptions import UndefinedError, TemplateRuntimeError, \
|
||||
TemplateNotFound
|
||||
from jinja2._compat import next, imap, text_type, iteritems, \
|
||||
implements_iterator, implements_to_string, string_types
|
||||
implements_iterator, implements_to_string, string_types, PY2
|
||||
|
||||
|
||||
# these variables are exported to the template runtime
|
||||
@ -216,7 +216,7 @@ class Context(object):
|
||||
items = _all('items')
|
||||
|
||||
# not available on python 3
|
||||
if hasattr(dict, 'iterkeys'):
|
||||
if PY2:
|
||||
iterkeys = _all('iterkeys')
|
||||
itervalues = _all('itervalues')
|
||||
iteritems = _all('iteritems')
|
||||
|
Loading…
Reference in New Issue
Block a user