From 510042160dffc780b926f35dc24174216015c723 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Mon, 1 Jul 2019 17:03:55 +0200 Subject: [PATCH] tools: avoid using directly _write_to_conf from kconfiglib Closes https://github.com/espressif/esp-idf/issues/3543 --- tools/kconfig_new/confgen.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/kconfig_new/confgen.py b/tools/kconfig_new/confgen.py index d4e8752902..496650cff9 100755 --- a/tools/kconfig_new/confgen.py +++ b/tools/kconfig_new/confgen.py @@ -349,10 +349,8 @@ def write_cmake(deprecated_options, config, filename): if not isinstance(sym, kconfiglib.Symbol): return - # Note: str_value calculates _write_to_conf, due to - # internal magic in kconfiglib... - val = sym.str_value - if sym._write_to_conf: + if sym.config_string: + val = sym.str_value if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE) and val == "n": val = "" # write unset values as empty variables write("set({}{} \"{}\")\n".format( @@ -380,8 +378,8 @@ def get_json_values(config): if not isinstance(sym, kconfiglib.Symbol): return - val = sym.str_value # this calculates _write_to_conf, due to kconfiglib magic - if sym._write_to_conf: + if sym.config_string: + val = sym.str_value if sym.type in [kconfiglib.BOOL, kconfiglib.TRISTATE]: val = (val != "n") elif sym.type == kconfiglib.HEX: