From c9ba20c5bbaa1b0ccb52d18214cf844994d0d0a7 Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Fri, 20 Mar 2015 16:25:20 -0700 Subject: [PATCH] Use six.moves to find urlencode and urlopen --- htsworkflow/pipelines/retrieve_config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htsworkflow/pipelines/retrieve_config.py b/htsworkflow/pipelines/retrieve_config.py index 69d8558..7c64050 100644 --- a/htsworkflow/pipelines/retrieve_config.py +++ b/htsworkflow/pipelines/retrieve_config.py @@ -8,6 +8,7 @@ import os import sys import types import six +from six.moves import urllib try: import json @@ -46,9 +47,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,)) -- 2.30.2