From 0bd841def7f3911771afa2346acae4938033ace9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sun, 11 Mar 2018 02:45:14 +0100 Subject: 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. --- kconfiglib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3