From ccb079631709d13712353dc32c9e53f0209f63b9 Mon Sep 17 00:00:00 2001 From: Neel Patel Date: Tue, 19 Feb 2019 13:18:37 +0000 Subject: [PATCH] Convert the JSON output from yarn properly --- tools/dependency_inventory.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/dependency_inventory.py b/tools/dependency_inventory.py index 339d177f4..c2f493382 100644 --- a/tools/dependency_inventory.py +++ b/tools/dependency_inventory.py @@ -149,7 +149,11 @@ def get_js_deps(): process.wait() # Cleanup the output - raw_data = json.loads(output.splitlines()[-1]) + output_str = output.splitlines()[-1] + if hasattr(output_str, 'decode'): + output_str = output_str.decode('utf-8') + raw_data = json.loads(output_str) + modules = raw_data['data']['body'] # Loop through the modules, and output the data.