summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2018-03-11 02:45:14 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2018-03-11 03:01:50 +0100
commit0bd841def7f3911771afa2346acae4938033ace9 (patch)
treeb3a68688f3f0f88d9ae903123e28ed17c6b34841
parent02d1131cf6ee76ce89e63121aa90512e153e15bf (diff)
Properly remember y user values for choice symbols
Commit e8b4ecb ("Don't special-case user_value for choice symbols set to y") was meant to make user_value reflect an y value assigned to a choice symbol, but didn't get it right for load_config() with replace=True: The user value was set at first, but was then unset again due to a misplaced '_was_set = True' assignment. This commit makes y choice symbol user values always be remembered. The correctness of generated files was not affected, since the user selection of a choice is actually remembered as Choice.user_selection. The previous commit just turned into a no-op for load_config() with replace=True.
-rw-r--r--kconfiglib.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index b733262..1a07da3 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -2982,6 +2982,7 @@ class Symbol(object):
value = STR_TO_TRI[value]
self.user_value = value
+ self._was_set = True
if self.choice and value == 2:
# Setting a choice symbol to y makes it the user selection of the
@@ -2992,7 +2993,6 @@ class Symbol(object):
self.choice._was_set = True
self.choice._rec_invalidate()
else:
- self._was_set = True
self._rec_invalidate_if_has_prompt()
return True