зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254884 - Make JSON serialization to config.status more readable as python. r=chmanchester
This commit is contained in:
Родитель
9015326e32
Коммит
4fa84e7822
|
@ -47,6 +47,10 @@ def config_status(config):
|
|||
with codecs.open('config.status', 'w', encoding) as fh:
|
||||
fh.write('#!%s\n' % config['PYTHON'])
|
||||
fh.write('# coding=%s\n' % encoding)
|
||||
# Because we're serializing as JSON but reading as python, the values
|
||||
# for True, False and None are true, false and null, which don't exist.
|
||||
# Define them.
|
||||
fh.write('true, false, null = True, False, None\n')
|
||||
for k, v in sanitized_config.iteritems():
|
||||
fh.write('%s = ' % k)
|
||||
json.dump(v, fh, sort_keys=True, indent=4, ensure_ascii=False)
|
||||
|
|
Загрузка…
Ссылка в новой задаче