fix bug shows with render mass test

This commit is contained in:
Benjamin Bertrand 2016-03-11 18:35:27 +03:00
parent 9a141ec2f7
commit 3abd4e89b5
1 changed files with 4 additions and 3 deletions

View File

@ -180,11 +180,12 @@ class Operator():
ans = ' '.join([str(i) for i in ans])
return ans
def r_parenthesis(self, op, str_join=False):
def r_parenthesis(self, opr, str_join=False):
""" Add parenthesis for rigth operand if necessary """
ans = op
ans = opr
try:
if op.mainOp.priority < self.priority:
if opr.mainOp.priority < self.priority or \
(opr.mainOp.name == 'mul' and opr[0] == '-'):
ans = flatten_list(["(", ans, ")"])
except AttributeError:
# op has not the attribute priority