Skip to content
Browse files

Make tower work with Jinja 2.6

  • Loading branch information...
1 parent 9735a63 commit a1d546f01264c4f6e438ec972472705390c01084 Dave Dash committed Apr 26, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 tower/template.py
View
8 tower/template.py
@@ -6,8 +6,12 @@
@jinja2.contextfunction
def _gettext_alias(context, string, *args, **kw):
- return jinja2.Markup(
- context.resolve('gettext')(string, *args, **kw))
+ meth = context.resolve('gettext')
+ if jinja2.__version__ > '2.5':
+ str = meth(context, string, **kw)
+ else:
+ str = meth(string, *args, **kw)
+ return jinja2.Markup(str)
class MozInternationalizationExtension(InternationalizationExtension):

0 comments on commit a1d546f

Please sign in to comment.
Something went wrong with that request. Please try again.