From 7f756313ff2ab02018f4721830021503dbbe64f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sun, 21 Apr 2024 06:52:41 -0400 Subject: [PATCH 1/2] graph.py: Update inputs and outputs set instead of returning a new set --- tools/fuzz_test/graph.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/fuzz_test/graph.py b/tools/fuzz_test/graph.py index 099859b..8d7ef0c 100644 --- a/tools/fuzz_test/graph.py +++ b/tools/fuzz_test/graph.py @@ -86,11 +86,10 @@ def parse_graph(path): for file in data["files"]: files[file['id']] = file for proc in data["procs"]: - proc_in = set(proc.get('input', [])) proc_out = set(proc.get('output', [])) - inputs = inputs | proc_in - outputs = outputs | proc_out + inputs.update(proc.get("input", [])) + outputs.update(proc_out) image = os.path.basename(files[proc['image']]['name']) for output in proc_out: built_by[files[output]['name']] = image From 5b3da2afddcc0dd600fb286ea03c175a3fdafe0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Sun, 21 Apr 2024 10:56:12 +0000 Subject: [PATCH 2/2] graph.py: Load json directly from file handle instead of from loading file to string and from string to json --- tools/fuzz_test/graph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/fuzz_test/graph.py b/tools/fuzz_test/graph.py index 8d7ef0c..d7fbda0 100644 --- a/tools/fuzz_test/graph.py +++ b/tools/fuzz_test/graph.py @@ -82,7 +82,7 @@ def parse_graph(path): outputs = set() built_by = {} with open(path, 'r') as f: - data = json.loads(f.read()) + data = json.load(f) for file in data["files"]: files[file['id']] = file for proc in data["procs"]: