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