Skip to content
Myr

[svn] fixed empty block bug

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 422934c · Browse files · 2 files+11 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−4 removed

  • other:+11 added−4 removed

2 files+11 added−4 removed

modified:jinja/translators/python.py+4 added-3 removed
299 unmodified lines
300 for n in requirements:301 lines.append(self.handle_node(n))302303 # the template body304 rv = self.handle_node_list(node)304 body_lines = [self.handle_node(n) for n in node]305 print list(node)306307 # add translation helpers if required308 if self.require_translations:309 lines.append(
2 unmodified lines
312 ' if p is None:\n'313 ' return translator.gettext(s) % (r or {})\n'314 ' return translator.ngettext(s, p, r[n]) % (r or {})'315 )315 lines.append(rv)316 lines.extend(body_lines)317 lines.append(' if False:\n yield None')318319 return '\n'.join(lines)320
208 unmodified lines
529 else.530 """531 rv = self.handle_node(node.body)532 if not rv:532 return533 return ''534535 buf = []536 write = lambda x: buf.append(self.indent(x))537
325 unmodified lines
modified:jinja/utils.py+7 added-1 removed
86 unmodified lines
87 """88 Raise an exception "in a template". Return a traceback89 object.90 """91 # some traceback systems allow to skip blocks92 __traceback_hide__ = True9394 offset = '\n' * (lineno - 1)95 code = compile(offset + 'raise __exception_to_raise__', filename, 'exec')96 namespace = context.to_dict()97 globals = {
125 unmodified lines
223 return default224225 def clear(self):226 self._mapping.clear()227 try:228 self._queue.clear()229 except AttributeError:224 del self._queue[:]230 del self._queue[:]231232 def __contains__(self, key):233 return key in self._mapping234
38 unmodified lines