summaryrefslogtreecommitdiff
path: root/networkx/convert.py
diff options
context:
space:
mode:
authoraric <none@none>2006-12-09 19:07:25 +0000
committeraric <none@none>2006-12-09 19:07:25 +0000
commitdf21621668e60c5145fd40b1f40d221aaa547760 (patch)
treeb53d716d2c0ace170d0163ea589ccfdd8bdc40d1 /networkx/convert.py
parente97849d10e99a5edba99b50d228043a3e2eb2a78 (diff)
downloadnetworkx-df21621668e60c5145fd40b1f40d221aaa547760.tar.gz
improve error message when attempting to convert a multigraph,
X*Graph(multiedges=True), to an adjacency matrix representation --HG-- extra : convert_revision : svn%3A3ed01bd8-26fb-0310-9e4c-ca1a4053419f/networkx/trunk%40494
Diffstat (limited to 'networkx/convert.py')
-rw-r--r--networkx/convert.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/networkx/convert.py b/networkx/convert.py
index b99fb8c5..f45317f4 100644
--- a/networkx/convert.py
+++ b/networkx/convert.py
@@ -235,8 +235,8 @@ def to_numpy_matrix(G,nodelist=None):
if hasattr(G,"multiedges"):
if G.multiedges==True:
- raise ImportError, \
- "Not allowed with for graphs with multiedges."
+ raise TypeError, \
+ "Conversion to numpy_matrix not allowed with for graphs with multiedges."
if nodelist is None:
nodelist=G.nodes()
@@ -337,8 +337,8 @@ def to_scipy_sparse_matrix(G,nodelist=None):
if hasattr(G,"multiedges"):
if G.multiedges==True:
- raise ImportError, \
- "Not allowed with for graphs with multiedges."
+ raise TypeError, \
+ "Conversion to scipy_sparse_matrix not allowed with for graphs with multiedges."
if nodelist is None:
nodelist=G.nodes()