From 04453ccf422539a2f5752a83084cfac7a8c701ee Mon Sep 17 00:00:00 2001 From: Elrond Date: Wed, 30 Jan 2013 15:03:04 +0100 Subject: Better Py3 compat: d.has_key(k) -> k in d py3 does not have dict.has_key any more. You have to use "key in dict" instead. As that works in python2 as well, let's use that. Also some small bits of pep8. --- mediagoblin/tools/template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mediagoblin/tools/template.py') diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py index d9c6e654..6e01a7dd 100644 --- a/mediagoblin/tools/template.py +++ b/mediagoblin/tools/template.py @@ -40,7 +40,7 @@ def get_jinja_env(template_loader, locale): # If we have a jinja environment set up with this locale, just # return that one. - if SETUP_JINJA_ENVS.has_key(locale): + if locale in SETUP_JINJA_ENVS: return SETUP_JINJA_ENVS[locale] # jinja2.StrictUndefined will give exceptions on references -- cgit v1.2.3