X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=blobdiff_plain;f=htsworkflow%2Futil%2Fopener.py;fp=htsworkflow%2Futil%2Fopener.py;h=ab83146d39604b1588301b7e016166721d889692;hp=035bb24dabc9cc43d2f9ae10a3fe8562243230fd;hb=53ebb47e86e81ce349d4ef4e16aef94be93486ea;hpb=4262586d10cc0cc227390873b301b55244204c11 diff --git a/htsworkflow/util/opener.py b/htsworkflow/util/opener.py index 035bb24..ab83146 100644 --- a/htsworkflow/util/opener.py +++ b/htsworkflow/util/opener.py @@ -5,7 +5,7 @@ import os import gzip import bz2 import types -import urllib2 +import urllib.request, urllib.error, urllib.parse def isfilelike(file_ref, mode): """Does file_ref have the core file operations? @@ -47,7 +47,7 @@ def autoopen(file_ref, mode='r'): elif isfilelike(file_ref, mode): return file_ref elif isurllike(file_ref, mode): - return urllib2.urlopen(file_ref) + return urllib.request.urlopen(file_ref) elif os.path.splitext(file_ref)[1] == ".gz": return gzip.open(file_ref, mode) elif os.path.splitext(file_ref)[1] == '.bz2':