sb/config.py: Fix operator reconstruction

Close #4337
This commit is contained in:
Ricardo Cárdenes 2021-03-10 21:32:08 -10:00 committed by Vijay Kumar Banerjee
parent d638f2b9a0
commit e5aa419d35

View File

@ -980,9 +980,9 @@ class file:
else: else:
if len(ifls) >= 3: if len(ifls) >= 3:
for op in ['==', '!=', '>=', '=>', '=<', '<=', '>', '<']: for op in ['==', '!=', '>=', '=>', '=<', '<=', '>', '<']:
ops = s.split(op) if op in ifls:
if len(ops) == 2: op_pos = ifls.index(op)
ifls = (ops[0], op, ops[1]) ifls = (' '.join(ifls[:op_pos]), op, ' '.join(ifls[op_pos + 1:]))
break break
if len(ifls) != 3: if len(ifls) != 3:
self._error('malformed if: ' + reduce(add, ls, '')) self._error('malformed if: ' + reduce(add, ls, ''))