Automated merge with ssh://team@pocoo.org/jinja2-main
authorArmin Ronacher <armin.ronacher@active-4.com>
Wed, 9 Apr 2008 13:03:33 +0000 (15:03 +0200)
committerArmin Ronacher <armin.ronacher@active-4.com>
Wed, 9 Apr 2008 13:03:33 +0000 (15:03 +0200)
--HG--
branch : trunk

1  2 
jinja2/optimizer.py

index 592a2948408aa7e8ad92ffd490215092de847ece,e98431c29d5227a88c884e55ea87b2cbeeada1fe..ee2f08266ac3dc5f7ebce18cfc84ab4e3f637b5b
@@@ -76,12 -76,9 +76,12 @@@ class Optimizer(NodeTransformer)
              return self.generic_visit(node, context)
          for filter in reversed(node.filters):
              # XXX: call filters with arguments
-             x = self.environment.filters[filter.name](self.environment, x)
+             x = self.environment.filters[filter.name](x)
              # XXX: don't optimize context dependent filters
 -        return nodes.Const(x)
 +        try:
 +            return nodes.Const.from_untrusted(x, lineno=node.lineno)
 +        except nodes.Impossible:
 +            return self.generic_visit(node)
  
      def visit_For(self, node, context):
          """Loop unrolling for iterable constant values."""