This commit is contained in:
mrT23
2024-05-22 21:47:49 +03:00
parent 811965d841
commit 4cd9626217
3 changed files with 8 additions and 1 deletions

View File

@ -23,7 +23,10 @@ def extend_patch(original_file_str, patch_str, num_lines) -> str:
return patch_str
if type(original_file_str) == bytes:
original_file_str = original_file_str.decode('utf-8')
try:
original_file_str = original_file_str.decode('utf-8')
except UnicodeDecodeError:
return ""
original_lines = original_file_str.splitlines()
patch_lines = patch_str.splitlines()