From: Armin Ronacher Date: Fri, 30 Mar 2007 20:28:49 +0000 (+0200) Subject: [svn] fixed SuperBlock bug X-Git-Tag: 2.0rc1~382 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7e07670b35d5001a4aba5a83806527fdd7703366;p=jinja2.git [svn] fixed SuperBlock bug --HG-- branch : trunk --- 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):