aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBonfaceKilz2020-08-19 03:31:53 +0300
committerBonfaceKilz2020-08-19 03:31:53 +0300
commit606ec8b9b3bbb8b2269ab546ebafa454f1753176 (patch)
tree2406e1491b6797a583dfcb64ac613378d28c45d4
parent1c3ade2f739608563cc1659dd93e5b2abc446046 (diff)
downloadgenenetwork2-606ec8b9b3bbb8b2269ab546ebafa454f1753176.tar.gz
Handle the rename of urllib and urllib2 to the urllib package
See: <https://docs.python.org/2/library/2to3.html#2to3fixer-urllib>
-rw-r--r--wqflask/base/trait.py2
-rw-r--r--wqflask/db/call.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index a513b589..2b8f2e72 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -6,7 +6,7 @@ import resource
import codecs
import requests
import random
-import urllib
+import urllib.request, urllib.parse, urllib.error
from base import webqtlConfig
from base.webqtlCaseData import webqtlCaseData
diff --git a/wqflask/db/call.py b/wqflask/db/call.py
index 1a1b3adc..82cfebb4 100644
--- a/wqflask/db/call.py
+++ b/wqflask/db/call.py
@@ -3,7 +3,7 @@
from flask import g
import string
-import urllib2
+import urllib.request, urllib.error, urllib.parse
import json
from utility.tools import USE_GN_SERVER, LOG_SQL, GN_SERVER_URL
from utility.benchmark import Bench
@@ -59,7 +59,7 @@ def gn_server(path):
"""
with Bench("GN_SERVER",LOG_SQL):
- res = urllib2.urlopen(GN_SERVER_URL+path)
+ res = urllib.request.urlopen(GN_SERVER_URL+path)
rest = res.read()
res2 = json.loads(rest)
logger.debug(res2)