Use urllib_request instead of urllib2 in PRESUBMIT.
urllib_request was introduced in crrev.com/c/1866170 to add
python 3 compatibility.
Bug: 1009814
Change-Id: Iecc246d4f251983051bd0cf812903831ea7e0c2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249588
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index cee3c5c..0b7e31f 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -313,7 +313,7 @@
input_api, output_api, json_url=json_url)
if not tree_status_results:
# Check for caution state only if tree is not closed.
- connection = input_api.urllib2.urlopen(json_url)
+ connection = input_api.urllib_request.urlopen(json_url)
status = input_api.json.loads(connection.read())
connection.close()
if ('caution' in status['message'].lower() and
@@ -328,7 +328,7 @@
message=short_text, long_text=long_text))
else:
# Tree status is closed. Put in message about contacting sheriff.
- connection = input_api.urllib2.urlopen(
+ connection = input_api.urllib_request.urlopen(
SKIA_TREE_STATUS_URL + '/current-sheriff')
sheriff_details = input_api.json.loads(connection.read())
if sheriff_details: