build: migrate urllib to python3 (#33737)

This commit is contained in:
Keeley Hammond 2022-04-12 14:07:40 -07:00 committed by GitHub
parent 3057ff0120
commit 2ca46058cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,7 +4,7 @@ from __future__ import print_function
import json import json
import os import os
import sys import sys
import urllib2 from urllib.request import Request, urlopen
sys.path.append( sys.path.append(
os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../..")) os.path.abspath(os.path.dirname(os.path.abspath(__file__)) + "/../.."))
@ -28,12 +28,12 @@ def is_json(myjson):
def get_content(retry_count = 5): def get_content(retry_count = 5):
try: try:
request = urllib2.Request( request = Request(
BASE_URL + version, BASE_URL + version,
headers={"Authorization" : authToken} headers={"Authorization" : authToken}
) )
proposed_content = urllib2.urlopen( proposed_content = urlopen(
request request
).read() ).read()