GitHub: Fix data decoding on Python 3.

master
Valentin Lorentz 2014-01-15 21:34:17 +00:00
parent 1c98e9a8d1
commit afe3053177
1 changed files with 4 additions and 1 deletions

View File

@ -107,7 +107,10 @@ def query(caller, type_, uri_end, args):
args = dict([(x,y) for x,y in args.items() if y is not None])
url = '%s/%s/%s?%s' % (caller._url(), type_, uri_end,
urlencode(args))
return json.load(utils.web.getUrlFd(url))
if sys.version_info[0] >= 3:
return json.loads(utils.web.getUrl(url).decode('utf8'))
else:
return json.load(utils.web.getUrlFd(url))
#####################
# Plugin itself