diff options
author | Armin Ronacher <armin.ronacher@active-4.com> | 2013-05-20 02:15:04 +0100 |
---|---|---|
committer | Armin Ronacher <armin.ronacher@active-4.com> | 2013-05-20 02:15:04 +0100 |
commit | ff0b5f58363d445a1d280e33ea3a3c71103e257a (patch) | |
tree | cf016a17dda00cf6d5c3f7b137fb32dce9ec7527 | |
parent | 146c9ba1706f82b5d891da8ffc119ac2ce2a69d4 (diff) | |
download | jinja2-ff0b5f58363d445a1d280e33ea3a3c71103e257a.tar.gz |
feature to version check for context dict methods
-rw-r--r-- | jinja2/runtime.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/jinja2/runtime.py b/jinja2/runtime.py index 71485c8..38a8697 100644 --- a/jinja2/runtime.py +++ b/jinja2/runtime.py @@ -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') |