diff options
author | marmeladema <xademax@gmail.com> | 2019-10-14 00:36:20 +0100 |
---|---|---|
committer | marmeladema <xademax@gmail.com> | 2019-10-16 00:22:07 +0100 |
commit | f1d42fe787c20ff2d62b0aab00874fe9c79af352 (patch) | |
tree | 7aacb29eb1243018d2610de3274ef0ac0edf665e /python/servo/testing_commands.py | |
parent | f063ea64a5023aa95f7165ed46d87c43c1f52340 (diff) | |
download | servo-f1d42fe787c20ff2d62b0aab00874fe9c79af352.tar.gz servo-f1d42fe787c20ff2d62b0aab00874fe9c79af352.zip |
Use urllib from six module in order to be compatible with Python3
Diffstat (limited to 'python/servo/testing_commands.py')
-rw-r--r-- | python/servo/testing_commands.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/python/servo/testing_commands.py b/python/servo/testing_commands.py index 2863c314426..a80b89cfb11 100644 --- a/python/servo/testing_commands.py +++ b/python/servo/testing_commands.py @@ -18,7 +18,7 @@ import copy from collections import OrderedDict import time import json -import urllib2 +import six.moves.urllib as urllib import base64 import shutil import subprocess @@ -510,9 +510,9 @@ class MachCommands(CommandBase): elif tracker_api.endswith('/'): tracker_api = tracker_api[0:-1] - query = urllib2.quote(failure['test'], safe='') - request = urllib2.Request("%s/query.py?name=%s" % (tracker_api, query)) - search = urllib2.urlopen(request) + query = urllib.parse.quote(failure['test'], safe='') + request = urllib.request.Request("%s/query.py?name=%s" % (tracker_api, query)) + search = urllib.request.urlopen(request) data = json.load(search) if len(data) == 0: actual_failures += [failure] @@ -521,11 +521,11 @@ class MachCommands(CommandBase): else: qstr = "repo:servo/servo+label:I-intermittent+type:issue+state:open+%s" % failure['test'] # we want `/` to get quoted, but not `+` (github's API doesn't like that), so we set `safe` to `+` - query = urllib2.quote(qstr, safe='+') - request = urllib2.Request("https://api.github.com/search/issues?q=%s" % query) + query = urllib.parse.quote(qstr, safe='+') + request = urllib.request.Request("https://api.github.com/search/issues?q=%s" % query) if encoded_auth: request.add_header("Authorization", "Basic %s" % encoded_auth) - search = urllib2.urlopen(request) + search = urllib.request.urlopen(request) data = json.load(search) if data['total_count'] == 0: actual_failures += [failure] |