diff kitten: Fix error when only RHS file is a binary file

Fixes #752
This commit is contained in:
Kovid Goyal
2018-07-28 13:58:27 +05:30
parent 3df78de3f8
commit 8a812c9d02
3 changed files with 7 additions and 3 deletions

View File

@@ -42,7 +42,7 @@ def generate_diff(collection, context):
for path, item_type, changed_path in collection:
if item_type == 'diff':
is_binary = isinstance(data_for_path(path), bytes)
is_binary = isinstance(data_for_path(path), bytes) or isinstance(data_for_path(changed_path), bytes)
if not is_binary:
d.add_diff(path, changed_path)