Commit 6775628e authored by Tien Mai's avatar Tien Mai Committed by Commit Bot

Fixing python 3 extension query script to also work for python < 3.6

Change-Id: Idb492e5564d90bce014dc91f35b6eec9c763c2ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2100111Reviewed-by: default avatarRoger Tawa <rogerta@chromium.org>
Commit-Queue: Tien Mai <tienmai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749788}
parent 5d04d88f
......@@ -2,7 +2,6 @@
# Copyright (c) 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Transform CBCM Takeout API Data (Python3)."""
import argparse
......@@ -171,8 +170,11 @@ def main(args):
browsers_processed = 0
while True:
print('Making request to server ...')
data = json.loads(
http.request(base_request_url + '?' + request_parameters, 'GET')[1])
response = http.request(base_request_url + '?' + request_parameters,
'GET')[1]
if isinstance(response, bytes):
response = response.decode('utf-8')
data = json.loads(response)
browsers_in_data = len(data['browsers'])
print('Request returned %s results, analyzing ...' % (browsers_in_data))
......
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