From d93c5f39efa58e9d5712542d95d17ea5570750c6 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 16 Mar 2012 20:05:40 +0100 Subject: [PATCH] Fix bug in template compilation where a trailing semicolon causes incorrect code to be generated. --- src/calibre/utils/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/utils/formatter.py b/src/calibre/utils/formatter.py index 2be42bc0ee..9932abc988 100644 --- a/src/calibre/utils/formatter.py +++ b/src/calibre/utils/formatter.py @@ -210,11 +210,11 @@ class _CompileParser(_Parser): return val if not self.token_op_is_a_semicolon(): return val - if self.compile_text: - self.compile_text += "\targs[%d] = list()\n"%(level,) self.consume() if self.token_is_eof(): return val + if self.compile_text: + self.compile_text += "\targs[%d] = list()\n"%(level,) def expr(self, level): if self.compile_text: