From 0d44b9e2f47a5a993ab44a1c5355c2ae245d4525 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 9 Feb 2018 00:31:50 +0100 Subject: Simplify visibility check in Choice._get_selection() The visibility of a symbol in an y-mode choice can only be n or y, so it's sufficient to check that it's not n (0). --- kconfiglib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index 0e19957..eaa9af8 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3472,10 +3472,11 @@ class Choice(object): # Warning: See Symbol._rec_invalidate(), and note that this is a hidden # function call (property magic) if self.tri_value != 2: + # Not in y mode, so no selection return None # Use the user selection if it's visible - if self.user_selection and self.user_selection.visibility == 2: + if self.user_selection and self.user_selection.visibility: return self.user_selection # Otherwise, check if we have a default -- cgit v1.2.3