Commit 9305c0de authored by Runar Borge's avatar Runar Borge
Browse files

Try to keep python 2.7 compability until at least netBSD gets gtk2 support on python3

parent 634c0faa
from __future__ import print_function
import os.path
import sys
import networkx as nx
import http.client
import sys
if (sys.version_info > (3, 0)):
import http.client as httplib
import httplib
def reciprocity(G):
"""Calculate reciprocity of graph, i.e. the ratio of the edges in
......@@ -73,7 +77,7 @@ def cap2str(capacity):
def read_linkloads(G, host, url):
conn = http.client.HTTPConnection(host)
conn = httplib.HTTPConnection(host)
conn.request("GET", url)
r1 = conn.getresponse()
if r1.status != 200:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment