# HG changeset patch # User hodgestar # Date 1331625665 0 # Node ID 2a45c61aedbc141ecaff8dec0589fa35208b3daa # Parent 6fc92535c88849a5f8b66fb0df028ccc71ca7c98 Move push and pop outside the loop in the ForDirective since it's equivalent to just pushing and popping on the edges. diff --git a/genshi/template/directives.py b/genshi/template/directives.py --- a/genshi/template/directives.py +++ b/genshi/template/directives.py @@ -378,13 +378,13 @@ assign = self.assign scope = {} + ctxt.push(scope) stream = list(stream) for item in iterable: assign(scope, item) - ctxt.push(scope) for event in _apply_directives(stream, directives, ctxt, vars): yield event - ctxt.pop() + ctxt.pop() def __repr__(self): return '<%s>' % type(self).__name__