Skip to content

Commit ff5c6dc

Browse files
mi-actargos
authored andcommitted
tools: properly convert .gypi in install.py
It was breaking during install when .gypi strings had quotes in them. e.g.: 'foo': 'bar="baz"'
1 parent 484140e commit ff5c6dc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/install.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22

3+
import ast
34
import errno
4-
import json
55
import os
66
import re
77
import shutil
@@ -20,9 +20,7 @@ def abspath(*args):
2020

2121
def load_config():
2222
s = open('config.gypi').read()
23-
s = re.sub(r'#.*?\n', '', s) # strip comments
24-
s = re.sub(r'\'', '"', s) # convert quotes
25-
return json.loads(s)
23+
return ast.literal_eval(s)
2624

2725
def try_unlink(path):
2826
try:

0 commit comments

Comments
 (0)