build: migrate urllib to python3 (#33737)
This commit is contained in:
parent
3057ff0120
commit
2ca46058cd
1 changed files with 3 additions and 3 deletions
|
@ -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()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue