Skip to content

Commit 726ff30

Browse files
committed
fix brawlers dictionary for 3.5
1 parent 2b8b2ea commit 726ff30

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

brawlstats/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ def __init__(self, base_url, version=1):
2424

2525
# Get current brawlers and their IDs
2626
try:
27-
data = json.loads(urllib.request.urlopen(self.CONSTANTS + '/characters').read())
27+
resp = urllib.request.urlopen(self.CONSTANTS + '/characters').read()
28+
if isinstance(resp, bytes):
29+
resp = resp.decode('utf-8')
30+
data = json.loads(resp)
2831
except (TypeError, urllib.error.HTTPError, urllib.error.URLError):
2932
self.BRAWLERS = {}
3033
else:

0 commit comments

Comments
 (0)