diff options
| author | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-02 08:18:54 +0100 |
|---|---|---|
| committer | Ulf Magnusson <ulfalizer@gmail.com> | 2017-11-02 08:46:19 +0100 |
| commit | b3d2a4eeea9002c15140cb80a5cd04b9839a88f6 (patch) | |
| tree | 87f08332ac277b5cdc5bf99d6b3311feadddb78c | |
| parent | 8aa106dfbd9f7dcce99f23c21b0c479eff874f2b (diff) | |
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.
| -rw-r--r-- | kconfiglib.py | 15 |
1 files changed, 8 insertions, 7 deletions
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 |
