INNER CODE UNIT · Python
raw
uxlfoundation/oneDAL · dev/release_tests/compare_release_trees.py:574
raw = (root / path).read_bytes()
text = raw.decode("utf-8", errors="replace")
# Keep the endings and render them, so a CRLF/LF difference is legible
# instead of invisible.
return [
line.replace("\r", "<CR>").replace("\n", "<LF>")
for line in text.splitlines(keepends=True)
]
diff = difflib.unified_diff(
read_lines(make_root),
read_lines(bazel_root),
fromfile="make",
tofile="bazel",
n=context,
lineterm="",
)
lines = list(diff)[:max_lines]