Drop support for simplejson
[htsworkflow.git] / htsworkflow / pipelines / retrieve_config.py
index 69d85584b3a610bd863a6e72cb1269ca02b56af1..a2153d055230d9b35e94cf8f39e9aecc3b73a339 100644 (file)
@@ -8,11 +8,9 @@ import os
 import sys
 import types
 import six
+from six.moves import urllib
 
-try:
-    import json
-except ImportError as e:
-    import simplejson as json
+import json
 
 from htsworkflow.auth import apidata
 from htsworkflow.util import api
@@ -46,9 +44,9 @@ def retrieve_flowcell_info(base_host_url, flowcell):
     url = api.flowcell_url(base_host_url, flowcell)
 
     try:
-        apipayload = urllib.urlencode(apidata)
-        web = urllib2.urlopen(url, apipayload)
-    except urllib2.URLError as e:
+        apipayload = urllib.parse.urlencode(apidata)
+        web = urllib.request.urlopen(url, apipayload)
+    except urllib.request.HTTPError as e:
         errmsg = 'URLError: %d %s' % (e.code, e.msg)
         LOGGER.error(errmsg)
         LOGGER.error('opened %s' % (url,))