0

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/+/2100111
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Commit-Queue: Tien Mai <tienmai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749788}
This commit is contained in:
Tien Mai
2020-03-12 18:28:32 +00:00
committed by Commit Bot
parent 5d04d88f25
commit 6775628eb6

@ -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))