Rename func_code attribute (pattern.graph)
@@ -824,7 +824,7 @@ def adjacency(graph, directed=False, reversed=False, stochastic=False, heuristic
# Bound method objects are transient,
# i.e., id(object.method) returns a new value each time.
if graph._adjacency is not None and \
- graph._adjacency[1:] == (directed, reversed, stochastic, heuristic and heuristic.func_code):
+ graph._adjacency[1:] == (directed, reversed, stochastic, heuristic and heuristic.__code__):
return graph._adjacency[0]
map = {}
for n in graph.nodes:
@@ -842,7 +842,7 @@ def adjacency(graph, directed=False, reversed=False, stochastic=False, heuristic
for id2 in map[id1]:
map[id1][id2] /= n
# Cache the adjacency map: this makes dijkstra_shortest_path() 2x faster in repeated use.
- graph._adjacency = (map, directed, reversed, stochastic, heuristic and heuristic.func_code)
+ graph._adjacency = (map, directed, reversed, stochastic, heuristic and heuristic.__code__)
return map
def dijkstra_shortest_path(graph, id1, id2, heuristic=None, directed=False):
