From 7c08c04080973ff3b723a43663f6dce378e517d7 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 13 Jun 2019 20:30:00 +0200 Subject: Hint towards sym.config_string where _write_to_conf is used It's pretty subtle that sym.config_string can be used instead of the internal sym._write_to_conf variable in client code. Mention it in comments near where _write_to_conf is used. Seen client code access _write_to_conf a few times now. No plans to remove it though, so it'll most likely keep working. --- kconfiglib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kconfiglib.py b/kconfiglib.py index 64f66b9..bfcc567 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1381,6 +1381,10 @@ class Kconfig(object): for sym in self.unique_defined_syms: # _write_to_conf is determined when the value is calculated. This # is a hidden function call due to property magic. + # + # Note: In client code, you can check if sym.config_string is empty + # instead, to avoid accessing the internal _write_to_conf variable + # (though it's likely to keep working). val = sym.str_value if not sym._write_to_conf: continue @@ -1689,6 +1693,10 @@ class Kconfig(object): for sym in self.unique_defined_syms: # _write_to_conf is determined when the value is calculated. This # is a hidden function call due to property magic. + # + # Note: In client code, you can check if sym.config_string is empty + # instead, to avoid accessing the internal _write_to_conf variable + # (though it's likely to keep working). val = sym.str_value # n tristate values do not get written to auto.conf and autoconf.h, -- cgit v1.2.3