From ff5c6dcd1ba832fdc2cda097facf789211f53a58 Mon Sep 17 00:00:00 2001 From: Michael Achenbach Date: Mon, 30 Apr 2018 14:08:28 +0200 Subject: [PATCH] tools: properly convert .gypi in install.py It was breaking during install when .gypi strings had quotes in them. e.g.: 'foo': 'bar="baz"' --- tools/install.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/install.py b/tools/install.py index 2aeed773bb08b3..ce9ceeee1dd578 100755 --- a/tools/install.py +++ b/tools/install.py @@ -1,7 +1,7 @@ #!/usr/bin/env python +import ast import errno -import json import os import re import shutil @@ -20,9 +20,7 @@ def abspath(*args): def load_config(): s = open('config.gypi').read() - s = re.sub(r'#.*?\n', '', s) # strip comments - s = re.sub(r'\'', '"', s) # convert quotes - return json.loads(s) + return ast.literal_eval(s) def try_unlink(path): try: