aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tools/template.py
diff options
context:
space:
mode:
authorBen Sturmfels <ben@sturm.com.au>2021-03-05 23:12:19 +1100
committerBen Sturmfels <ben@sturm.com.au>2021-03-05 23:12:19 +1100
commitdec47c7102cf0aa3a4debf002928db8e460c0d71 (patch)
tree47631fc15c7af172aa699506adf3d76d3a71976c /mediagoblin/tools/template.py
parent5f3a782fef4855e10b7259624a14d8afb0f7be93 (diff)
downloadmediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.lz
mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.tar.xz
mediagoblin-dec47c7102cf0aa3a4debf002928db8e460c0d71.zip
Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.
Diffstat (limited to 'mediagoblin/tools/template.py')
-rw-r--r--mediagoblin/tools/template.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/mediagoblin/tools/template.py b/mediagoblin/tools/template.py
index f2619808..1a335fe4 100644
--- a/mediagoblin/tools/template.py
+++ b/mediagoblin/tools/template.py
@@ -65,12 +65,8 @@ def get_jinja_env(app, template_loader, locale):
'jinja2.ext.i18n', 'jinja2.ext.autoescape',
TemplateHookExtension] + local_exts)
- if six.PY2:
- template_env.install_gettext_callables(mg_globals.thread_scope.translations.ugettext,
- mg_globals.thread_scope.translations.ungettext)
- else:
- template_env.install_gettext_callables(mg_globals.thread_scope.translations.gettext,
- mg_globals.thread_scope.translations.ngettext)
+ template_env.install_gettext_callables(mg_globals.thread_scope.translations.gettext,
+ mg_globals.thread_scope.translations.ngettext)
# All templates will know how to ...
# ... fetch all waiting messages and remove them from the queue
@@ -164,7 +160,7 @@ class TemplateHookExtension(Extension):
... will include all templates hooked into the comment_extras section.
"""
- tags = set(["template_hook"])
+ tags = {"template_hook"}
def parse(self, parser):
includes = []