Refactor: More f-string for kittens

This commit is contained in:
pagedown
2022-01-29 20:23:34 +08:00
parent 4110074580
commit 4a3ed62809
18 changed files with 32 additions and 32 deletions

View File

@@ -244,14 +244,14 @@ class Differ:
except Exception as e:
return f'Running git diff for {left_path} vs. {right_path} generated an exception: {e}'
if not ok:
return output + f'\nRunning git diff for {left_path} vs. {right_path} failed'
return f'{output}\nRunning git diff for {left_path} vs. {right_path} failed'
left_lines = lines_for_path(left_path)
right_lines = lines_for_path(right_path)
try:
patch = parse_patch(output)
except Exception:
import traceback
return traceback.format_exc() + f'\nParsing diff for {left_path} vs. {right_path} failed'
return f'{traceback.format_exc()}\nParsing diff for {left_path} vs. {right_path} failed'
else:
ans[key] = patch
return ans