1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Merge pull request #2159 from stoned/diff-output

Fix diff output vertical spacing
This commit is contained in:
Daniel Hokka Zakrisson 2013-02-21 12:22:04 -08:00
commit 2225ee4b85

View file

@ -627,8 +627,8 @@ def get_diff(before, after):
try:
with warnings.catch_warnings():
warnings.simplefilter('ignore')
differ = difflib.unified_diff(before.split("\n"), after.split("\n"), 'before', 'after', '', '', 10)
return "\n".join(list(differ))
differ = difflib.unified_diff(before.splitlines(True), after.splitlines(True), 'before', 'after', '', '', 10)
return "".join(list(differ))
except UnicodeDecodeError:
return ">> the files are different, but the diff library cannot compare unicode strings"