From: rtrimana Date: Wed, 21 Feb 2018 19:40:23 +0000 (-0800) Subject: Fixing G.nodes() iteration that needs us to force Python to create a copy for iterati... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dcf2919c480a13f2214725453f3ec3c41fedf26c;p=pingpong.git Fixing G.nodes() iteration that needs us to force Python to create a copy for iteration condition by adding list() --- diff --git a/base_gexf_generator.py b/base_gexf_generator.py index 5874b21..34c0631 100644 --- a/base_gexf_generator.py +++ b/base_gexf_generator.py @@ -106,7 +106,7 @@ def traverse_and_merge_nodes(G, dev_list_file): dev_list = create_device_list(DEVICE_MAC_LIST) # Traverse every node # Check that the node is not a smarthome device - for node in nodes: + for node in list(nodes): neighbors = G[node] #G.neighbors(node) #print "Neighbors: ", neighbors, "\n" # Skip if the node is a smarthome device