summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-06-13 20:30:00 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-06-13 20:35:30 +0200
commit7c08c04080973ff3b723a43663f6dce378e517d7 (patch)
tree30120fccd6c4833bef4710a1bfe887f2141aa627
parentd204d572d61ca01b3a38fea229a438d108460f9b (diff)
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.
-rw-r--r--kconfiglib.py8
1 files changed, 8 insertions, 0 deletions
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,