From 439fbf0af59e9b3df55c9288a4b4563051517092 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 13 Nov 2023 21:03:43 -0500 Subject: [PATCH] graphdiff: handle unlabeled nodes Witnessed in graphs generated by `ninja -t graph`. --- graphdiff/graphdiff.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphdiff/graphdiff.py b/graphdiff/graphdiff.py index b7aa821..9292ef7 100644 --- a/graphdiff/graphdiff.py +++ b/graphdiff/graphdiff.py @@ -109,7 +109,8 @@ def remove_quotes(pydot_graph): This function removes it.""" for node in pydot_graph.get_nodes(): - node.set_label(node.get_label().replace('"', '')) + if node.get_label(): + node.set_label(node.get_labe().replace('"', '')) for edge in pydot_graph.get_edges(): if edge.get_label():