aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/command_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r--python/servo/command_base.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index 67f91e6a1d4..176ecd89e48 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -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)