Fix incorrect error handling in ipapython/graph.py

fix: correction in exception type for remove_edge

the previous code raises the KeyError but the list.remove() actually raises ValueError so the Actual problem was not getting resolved.

Fixes:https://pagure.io/freeipa/issue/9876

signed-off-by: Sami Shaikh 1694samishaikh@gmail.com
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
This commit is contained in:
MOHAMMAD SAMI authored and Rafael Guterres Jeffman committed 2025-12-16 11:23:26 -03:00
1 parent 386e9f37af
commit f094818347
1 file changed
+1 -1
+1 -1
View File
@@ -34,7 +34,7 @@ class Graph:
def remove_edge(self, tail, head):
try:
self.edges.remove((tail, head))
except KeyError:
except ValueError:
raise ValueError(
"graph does not contain edge: ({0}, {1})".format(tail, head)
)