mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix formatter infix operators not handling raw_field of undefined values
This commit is contained in:
parent
b0089fe42c
commit
38d34bd003
@ -1041,8 +1041,9 @@ class _Interpreter:
|
||||
|
||||
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…
x
Reference in New Issue
Block a user