Skip to content

tool: Fixed bug causing JSON format to be broken

Rodrigo Muino Tomonari requested to merge github/fork/mawaregetsuka/local into master

The JSON format in the current version of the config.gypi file can be broken because the pprint.pformat function splits the argument string into multiple lines if it is long enough and contains Spaces

./configure --v8-options="--this_is_parameter_one --this_is_parmaeter_two"
//This is the corresponding line in configure.gypi
                 'node_v8_options': '--this_is_parameter_one '
                                    '--this_is_parmaeter_two',

You can see that function pprint.pformat accidentally splits the string into two lines, causing the JSON format to be broken

I can think of three solutions

1 Abandon the line length limit

2 Use regular matches after pprint.pformat

3 Manually implement an appropriate print function

I chose the simplest solution for this PR and am glad to work on other solutions if the administrator thinks it is necessary

Merge request reports

Loading