Skip to content

Commit 86b1fd6

Browse files
authored
Add error message if files doesn't exist
1 parent fccdfa6 commit 86b1fd6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/bindiff/bindiff.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,14 @@ def raw_diffing(p1_path: Union[Path, str], p2_path: Union[Path, str], out_diff:
291291
f1 = Path(p1_path)
292292
f2 = Path(p2_path)
293293

294+
if not f1.exists():
295+
logging.error(f"file '{p1_path}' doesn't exist")
296+
return False
297+
298+
if not f2.exists():
299+
logging.error(f"file '{p2_path}' doesn't exist")
300+
return False
301+
294302
cmd_line = [
295303
BINDIFF_BINARY.as_posix(),
296304
f"--primary={p1_path}",

0 commit comments

Comments
 (0)