handle encoding properly when outputting diff

This commit is contained in:
Velo Superman
2013-03-03 14:19:23 +01:00
parent d7848cd34c
commit a2afe79644

View File

@@ -26,11 +26,13 @@ def _diff(old, new, desc):
raise AssertionError(
("\nError while comparing strings:\n"
"%s") % (output, ))
"%s") % (output.encode('utf-8'), ))
def diffStrings(orig, new, desc='input'):
assert type(orig) == type(new)
def _tolines(s):
return [line + '\n' for line in s.split('\n')]