diff --git a/sqlgraph/sqlgraph.py b/sqlgraph/sqlgraph.py index 6e483f7..de83234 100644 --- a/sqlgraph/sqlgraph.py +++ b/sqlgraph/sqlgraph.py @@ -75,7 +75,7 @@ def remove_edge(self, fromnode, tonode, cursor=None): @cursored def get_node_data(self, node, cursor=None): - result = cursor.execute('select * from %s_nodes where node=?'%self.name, node) + result = cursor.execute('select * from %s_nodes where node=?'%self.name, (node,)) for row in result: return row[0] else: @@ -87,7 +87,7 @@ def get_edge_data(self, fromnode, tonode, cursor=None): for row in result: return row[0] else: - raise Exception('Node %s is not in graph.' % node) + raise Exception('Edge %s:%s is not in graph.' % (fromnode, tonode)) def from_nx(self, G): self.name = _encode(G.name)