fix for issue615: _format_boolop must escape %

fix test for issue615: expression must eval False

--HG--
branch : format_boolop_percent6
This commit is contained in:
TomV
2014-10-27 08:31:33 +00:00
parent f2cdbe776e
commit f6caf230f8
3 changed files with 12 additions and 8 deletions

View File

@@ -382,7 +382,12 @@ def _should_repr_global_name(obj):
return not hasattr(obj, "__name__") and not py.builtin.callable(obj)
def _format_boolop(explanations, is_or):
return "(" + (is_or and " or " or " and ").join(explanations) + ")"
explanation = "(" + (is_or and " or " or " and ").join(explanations) + ")"
if py.builtin._istext(explanation):
t = py.builtin.text
else:
t = py.builtin.bytes
return explanation.replace(t('%'), t('%%'))
def _call_reprcompare(ops, results, expls, each_obj):
for i, res, expl in zip(range(len(ops)), results, expls):