From b3d2a4eeea9002c15140cb80a5cd04b9839a88f6 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Thu, 2 Nov 2017 08:18:54 +0100 Subject: Don't set promptless symbols when loading .config Return braino. Harmless but inconsistent (since the user value wasn't set for promptless symbols when manually calling set_value()). Also caused a lot of redundant invalidation. Cuts test_defconfig() down to 2m32s from 3m00s with CPython, so skipping global invalidation definitely pays off now. Downside is you lose information on what value the .config had for the symbol. Not sure if anyone would ever need that information (and it should be simple to add if needed). It would usually match the actual value of the symbol. --- kconfiglib.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index d5143cf..32a4041 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -2543,15 +2543,16 @@ class Symbol(object): .format(self.name, value)) return - # Assignments to promptless symbols are expected when loading a .config - if not self.kconfig._loading_config: - for node in self.nodes: - if node.prompt is not None: - break - else: + for node in self.nodes: + if node.prompt is not None: + break + else: + # Assignments to promptless symbols are expected when loading a + # .config + if not self.kconfig._loading_config: self.kconfig._warn("{} has no prompt. '{}' assignment ignored." .format(self.name, value)) - return + return if self.choice is not None and value == 2: # Remember this as a choice selection only. Makes switching back -- cgit v1.2.3