tools: properly convert .gypi in install.py

It was breaking during install when .gypi strings had quotes in
them. e.g.: 'foo': 'bar="baz"'
This commit is contained in:
Michael Achenbach 2018-04-30 14:08:28 +02:00 committed by Yang Guo
parent d0a545ca38
commit 5e5ffc81fa

View File

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