applied the except and raise fixers to the master branch to close the gap with py3
[nepi.git] / src / nepi / util / netgraph.py
index 8a36d15..49a194b 100644 (file)
@@ -188,7 +188,7 @@ class NetGraph(object):
     def annotate_node(self, nid, name, value):
         if not isinstance(value, str) and not isinstance(value, int) and \
                 not isinstance(value, float) and not isinstance(value, bool):
-            raise RuntimeError, "Non-serializable annotation"
+            raise RuntimeError("Non-serializable annotation")
 
         self.topology.node[nid][name] = value
     
@@ -204,7 +204,7 @@ class NetGraph(object):
     def annotate_edge(self, nid1, nid2, name, value):
         if not isinstance(value, str) and not isinstance(value, int) and \
                 not isinstance(value, float) and not isinstance(value, bool):
-            raise RuntimeError, "Non-serializable annotation"
+            raise RuntimeError("Non-serializable annotation")
 
         self.topology.edge[nid1][nid2][name] = value
    
@@ -256,7 +256,7 @@ class NetGraph(object):
             net = ipaddr.IPv6Network(netblock)
             new_prefix = 30
         else:
-            raise RuntimeError, "Invalid IP version %d" % version
+            raise RuntimeError("Invalid IP version %d" % version)
         
         ## Clear all previusly assigned IPs
         for nid in self.topology.nodes():