Skip to content

Commit

Permalink
configure: don't serialize empty array elements
Browse files Browse the repository at this point in the history
Before this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = ['']

After this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = []
  • Loading branch information
Jon Gjengset committed Mar 10, 2022
1 parent ba14a83 commit 7c20a29
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def build():


def set(key, value):
if isinstance(value, list):
# Remove empty values, which value.split(',') tends to generate.
value = [v for v in value if v]

s = "{:20} := {}".format(key, value)
if len(s) < 70:
p(s)
Expand Down

0 comments on commit 7c20a29

Please sign in to comment.