Commit e2686734 authored by Milad Farazmand's avatar Milad Farazmand Committed by LUCI CQ

Make fetch compatible with py 3.5

Running `fetch v8` with Python 3.5 produces the following error:
TypeError: the JSON object must be str, not 'bytes'

Adding `.decode("utf-8")` makes it compatible with both versions.

Change-Id: Ib0699b61b24f191559c30f1e7ca8d2c919803d03
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2154108Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
parent 888c0fe7
......@@ -267,14 +267,14 @@ def run_config_fetch(config, props, aliased=False):
cmd = [sys.executable, config_path + '.py', 'fetch'] + props
result = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
spec = json.loads(result)
spec = json.loads(result.decode("utf-8"))
if 'alias' in spec:
assert not aliased
return run_config_fetch(
spec['alias']['config'], spec['alias']['props'] + props, aliased=True)
cmd = [sys.executable, config_path + '.py', 'root']
result = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
root = json.loads(result)
root = json.loads(result.decode("utf-8"))
return spec, root
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment