From 7c20a29af8bffdd393e9e8a716de8266fcdae8bc Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Thu, 10 Mar 2022 12:39:29 -0800 Subject: [PATCH] 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 = [] --- src/bootstrap/configure.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py index 94424cb4548fa..87a130a09827d 100755 --- a/src/bootstrap/configure.py +++ b/src/bootstrap/configure.py @@ -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)