Skip to content

Commit c9c2e0c

Browse files
committed
Python 3.4 and 3.5 compat
1 parent 2517a70 commit c9c2e0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

dev/gendoc.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ def get_json(url):
5454
request = Request(url)
5555
if GITHUB_OAUTH_KEY:
5656
request.add_header('Authorization', 'token %s' % GITHUB_OAUTH_KEY)
57-
return json.load(urlopen(request))
57+
58+
response = urlopen(request).read()
59+
if isinstance(response, bytes):
60+
response = response.decode('utf-8')
61+
return json.loads(response)
5862
except HTTPError as e:
5963
if "X-RateLimit-Remaining" in e.headers and e.headers["X-RateLimit-Remaining"] == '0':
6064
print("Exceeded the GitHub API rate limit; see the instructions in " +

0 commit comments

Comments
 (0)