summaryrefslogtreecommitdiff
path: root/networkx/linalg/attrmatrix.py
diff options
context:
space:
mode:
Diffstat (limited to 'networkx/linalg/attrmatrix.py')
-rw-r--r--networkx/linalg/attrmatrix.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/networkx/linalg/attrmatrix.py b/networkx/linalg/attrmatrix.py
index ffa6fa5b..6d9eab6d 100644
--- a/networkx/linalg/attrmatrix.py
+++ b/networkx/linalg/attrmatrix.py
@@ -34,7 +34,7 @@ def _node_value(G, node_attr):
def value(u):
return u
- elif not hasattr(node_attr, "__call__"):
+ elif not callable(node_attr):
# assume it is a key for the node attribute dictionary
def value(u):
return G.nodes[u][node_attr]
@@ -94,7 +94,7 @@ def _edge_value(G, edge_attr):
def value(u, v):
return 1
- elif not hasattr(edge_attr, "__call__"):
+ elif not callable(edge_attr):
# assume it is a key for the edge attribute dictionary
if edge_attr == "weight":