Skip to content

Commit

Permalink
Rollup merge of #94819 - jonhoo:configure-empty-list, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
configure: don't serialize empty array elements

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
Dylan-DPC committed Mar 11, 2022
2 parents 6d66020 + 7c20a29 commit bb8274a
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 bb8274a

Please sign in to comment.