From 86b1fd60bbf2de7ca53633c250707eef1105e9d1 Mon Sep 17 00:00:00 2001 From: "Celian G." Date: Fri, 29 Nov 2024 16:33:02 +0100 Subject: [PATCH] Add error message if files doesn't exist --- src/bindiff/bindiff.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/bindiff/bindiff.py b/src/bindiff/bindiff.py index 8dee8d3..95571e3 100644 --- a/src/bindiff/bindiff.py +++ b/src/bindiff/bindiff.py @@ -291,6 +291,14 @@ def raw_diffing(p1_path: Union[Path, str], p2_path: Union[Path, str], out_diff: f1 = Path(p1_path) f2 = Path(p2_path) + if not f1.exists(): + logging.error(f"file '{p1_path}' doesn't exist") + return False + + if not f2.exists(): + logging.error(f"file '{p2_path}' doesn't exist") + return False + cmd_line = [ BINDIFF_BINARY.as_posix(), f"--primary={p1_path}",