mirror of
https://github.com/servo/servo.git
synced 2025-07-18 21:03:45 +01:00
Use urllib from six module in order to be compatible with Python3
This commit is contained in:
parent
f063ea64a5
commit
f1d42fe787
8 changed files with 28 additions and 28 deletions
|
@ -27,7 +27,7 @@ import tarfile
|
|||
import zipfile
|
||||
from xml.etree.ElementTree import XML
|
||||
from servo.util import download_file
|
||||
import urllib2
|
||||
import six.moves.urllib as urllib
|
||||
from bootstrap import check_gstreamer_lib
|
||||
|
||||
from mach.decorators import CommandArgument
|
||||
|
@ -506,15 +506,15 @@ class CommandBase(object):
|
|||
nightly_date = nightly_date.strip()
|
||||
# Fetch the filename to download from the build list
|
||||
repository_index = NIGHTLY_REPOSITORY_URL + "?list-type=2&prefix=nightly"
|
||||
req = urllib2.Request(
|
||||
req = urllib.request.Request(
|
||||
"{}/{}/{}".format(repository_index, os_prefix, nightly_date))
|
||||
try:
|
||||
response = urllib2.urlopen(req).read()
|
||||
response = urllib.request.urlopen(req).read()
|
||||
tree = XML(response)
|
||||
namespaces = {'ns': tree.tag[1:tree.tag.index('}')]}
|
||||
file_to_download = tree.find('ns:Contents', namespaces).find(
|
||||
'ns:Key', namespaces).text
|
||||
except urllib2.URLError as e:
|
||||
except urllib.error.URLError as e:
|
||||
print("Could not fetch the available nightly versions from the repository : {}".format(
|
||||
e.reason))
|
||||
sys.exit(1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue