summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2019-07-01 22:18:50 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2019-07-01 23:48:21 +0200
commit7892cfef16e8b3d1745feafe20306a783ddf770f (patch)
tree26fffff404d49af054572b9a19be90cfb59e3e56
parent8105b8b04cb1d90efaf7e0c20946c956ee85f5ed (diff)
Get rid of some STRING/INT/HEX tests
Things can be simplified a bit knowing that UNKNOWN is falsy.
-rw-r--r--kconfiglib.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 12471a9..838e4e7 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -3637,7 +3637,7 @@ class Kconfig(object):
TYPE_TO_STR[target_sym.orig_type],
_name_and_loc(target_sym)))
- elif sym.orig_type in _STRING_INT_HEX:
+ elif sym.orig_type: # STRING/INT/HEX
for default, _ in sym.defaults:
if default.__class__ is not Symbol:
raise KconfigError(
@@ -4805,7 +4805,7 @@ class Symbol(object):
return TRI_TO_STR[val]
- if self.orig_type in _STRING_INT_HEX:
+ if self.orig_type: # STRING/INT/HEX
for default, cond in self.defaults:
if expr_value(cond):
return default.str_value
@@ -6933,12 +6933,6 @@ _INT_HEX = frozenset((
HEX,
))
-_STRING_INT_HEX = frozenset((
- STRING,
- INT,
- HEX,
-))
-
_SYMBOL_CHOICE = frozenset((
Symbol,
Choice,