mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 12:44:35 +01:00
Fix formatter infix operators not handling raw_field of undefined values
This commit is contained in:
parent
b0089fe42c
commit
38d34bd003
1 changed files with 3 additions and 2 deletions
|
|
@ -1041,8 +1041,9 @@ def do_node_logop_unary(self, prog):
|
|||
|
||||
def do_node_binary_arithop(self, prog):
|
||||
try:
|
||||
answer = self.ARITHMETIC_BINARY_OPS[prog.operator](float(self.expr(prog.left)),
|
||||
float(self.expr(prog.right)))
|
||||
answer = self.ARITHMETIC_BINARY_OPS[prog.operator](
|
||||
self.float_deal_with_none(self.expr(prog.left)),
|
||||
self.float_deal_with_none(self.expr(prog.right)))
|
||||
res = str(answer if modf(answer)[0] != 0 else int(answer))
|
||||
if (self.break_reporter):
|
||||
self.break_reporter(prog.node_name, res, prog.line_number)
|
||||
|
|
|
|||
Loading…
Reference in a new issue