Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

feature to version check for context dict methods

  • Loading branch information...
commit ff0b5f58363d445a1d280e33ea3a3c71103e257a 1 parent 146c9ba
@mitsuhiko authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 jinja2/runtime.py
View
4 jinja2/runtime.py
@@ -15,7 +15,7 @@
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 @@ def _all(meth):
items = _all('items')
# not available on python 3
- if hasattr(dict, 'iterkeys'):
+ if PY2:
iterkeys = _all('iterkeys')
itervalues = _all('itervalues')
iteritems = _all('iteritems')
Please sign in to comment.
Something went wrong with that request. Please try again.