Commit 23f6f40f authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Fix bug with self-loops in Graph.clear_vertex()

Since the same edge appears twice in Vertex.all_edges() if it is a
self_loop, it would be deleted twice in Graph.clear_vertex(), raising an
exception. Now, the edges are stored in a set first, avoiding this
parent 4708d11d
......@@ -518,9 +518,9 @@ class Graph(object):
def clear_vertex(self, vertex):
"""Remove all in and out-edges from the given vertex."""
del_es = []
del_es = set()
for e in vertex.all_edges():
for e in del_es:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment