From 7e07670b35d5001a4aba5a83806527fdd7703366 Mon Sep 17 00:00:00 2001 From: Armin Ronacher Date: Fri, 30 Mar 2007 22:28:49 +0200 Subject: [PATCH] [svn] fixed SuperBlock bug --HG-- branch : trunk --- jinja/datastructure.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/jinja/datastructure.py b/jinja/datastructure.py index abd2ce1..cd93568 100644 --- a/jinja/datastructure.py +++ b/jinja/datastructure.py @@ -328,21 +328,17 @@ class SuperBlock(object): self.stack = blocks[name] self.level = level else: - self.stack is None - if len(stack) > level: - self.block = stack[level] + self.stack = None def __call__(self, offset=1): - level = self.level + (offset - 1) - if level < len(self.stack): - return self.stack[level](self.context) + if self.stack is not None: + level = self.level + (offset - 1) + if level < len(self.stack): + return self.stack[level](self.context) raise TemplateRuntimeError('no super block for %r' % self.name) def __repr__(self): - return '' % ( - self.name, - self.stack is None and 'im' or '' - ) + return '' % self.name class TokenStream(object): -- 2.26.2