summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-03-05 03:30:21 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-03-05 04:09:54 +0100
commit51194d6fd5e276e61094120033aa3e14f23cbd18 (patch)
tree96eb66c781befe3978dcf769a5970c76be23cbe0
parent3358706024fd13676308a0059328ede32a8f0ed5 (diff)
Simplify sync_deps() value tests
Use the result from the initial str_value call in more places. Also add a comment to make it clear how _write_to_conf is calculated, mirroring the ones in write_config() and write_autoconf().
-rw-r--r--kconfiglib.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 0543c95..afd480e 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -1033,6 +1033,9 @@ class Kconfig(object):
self._load_old_vals()
for sym in self.defined_syms:
+ # Note: _write_to_conf is determined when the value is
+ # calculated. This is a hidden function call due to
+ # property magic.
val = sym.str_value
# Note: n tristate values do not get written to auto.conf and
@@ -1041,12 +1044,12 @@ class Kconfig(object):
if sym._write_to_conf:
if sym._old_val is None and \
sym.orig_type in (BOOL, TRISTATE) and \
- not sym.tri_value:
+ val == "n":
# No old value (the symbol was missing or n), new value n.
# No change.
continue
- if sym.str_value == sym._old_val:
+ if val == sym._old_val:
# New value matches old. No change.
continue