summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kconfiglib.py20
-rw-r--r--testsuite.py44
2 files changed, 29 insertions, 35 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index a4bfbb1..0aadf2f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -607,9 +607,9 @@ class Config(object):
if self._config_filename is None
else self._config_filename),
"Print warnings : " +
- _BOOL_STR[self._print_warnings],
+ str(self._print_warnings),
"Print assignments to undefined symbols : " +
- _BOOL_STR[self._print_undef_assign])
+ str(self._print_undef_assign))
#
# Private methods
@@ -1786,10 +1786,10 @@ class Config(object):
"Value : " + s(sc.get_value()),
"User value : " + user_val_str,
"Visibility : " + s(_get_visibility(sc)),
- "Is choice item : " + _BOOL_STR[sc._is_choice_sym],
- "Is defined : " + _BOOL_STR[sc._is_defined],
- "Is from env. : " + _BOOL_STR[sc._is_from_env],
- "Is special : " + _BOOL_STR[sc._is_special],
+ "Is choice item : " + str(sc._is_choice_sym),
+ "Is defined : " + str(sc._is_defined),
+ "Is from env. : " + str(sc._is_from_env),
+ "Is special : " + str(sc._is_special),
"")
if sc._ranges:
res += _lines("Ranges:", ranges_str + "\n")
@@ -1849,7 +1849,7 @@ class Config(object):
"User value : " + user_val_str,
"Mode : " + s(sc.get_mode()),
"Visibility : " + s(_get_visibility(sc)),
- "Optional : " + _BOOL_STR[sc._optional],
+ "Optional : " + str(sc._optional),
"Prompts:",
prompts_str,
"Defaults:",
@@ -3573,12 +3573,6 @@ _get_keyword = {
"visible": _T_VISIBLE,
}.get
-# Strings to use for True and False
-_BOOL_STR = {
- False: "false",
- True: "true",
-}
-
# Tokens after which identifier-like lexemes are treated as strings. _T_CHOICE
# is included to avoid symbols being registered for named choices.
_STRING_LEX = frozenset((
diff --git a/testsuite.py b/testsuite.py
index b2f306a..b193414 100644
--- a/testsuite.py
+++ b/testsuite.py
@@ -541,8 +541,8 @@ def run_selftests():
Value of $SRCARCH at creation time : (not set)
Value of $srctree at creation time : (not set)
Most recently loaded .config : (no .config loaded)
- Print warnings : true
- Print assignments to undefined symbols : false""")
+ Print warnings : True
+ Print assignments to undefined symbols : False""")
os.environ["ARCH"] = "foo"
os.environ["SRCARCH"] = "bar"
@@ -561,8 +561,8 @@ def run_selftests():
Value of $SRCARCH at creation time : bar
Value of $srctree at creation time : baz
Most recently loaded .config : Kconfiglib/tests/empty
- Print warnings : false
- Print assignments to undefined symbols : true""")
+ Print warnings : False
+ Print assignments to undefined symbols : True""")
# Printing of Symbol
@@ -572,10 +572,10 @@ def run_selftests():
Value : "n"
User value : (no user value)
Visibility : "n"
- Is choice item : false
- Is defined : true
- Is from env. : false
- Is special : false
+ Is choice item : False
+ Is defined : True
+ Is from env. : False
+ Is special : False
Prompts:
(no prompts)
Default values:
@@ -600,10 +600,10 @@ def run_selftests():
Value : "y"
User value : "m"
Visibility : "y"
- Is choice item : false
- Is defined : true
- Is from env. : false
- Is special : false
+ Is choice item : False
+ Is defined : True
+ Is from env. : False
+ Is special : False
Prompts:
"advanced prompt 1" if y || BASIC && BASIC (value: "y")
"advanced prompt 2"
@@ -632,10 +632,10 @@ def run_selftests():
Value : "foo"
User value : (no user value)
Visibility : "n"
- Is choice item : false
- Is defined : true
- Is from env. : false
- Is special : false
+ Is choice item : False
+ Is defined : True
+ Is from env. : False
+ Is special : False
Prompts:
(no prompts)
Default values:
@@ -663,10 +663,10 @@ def run_selftests():
Value : "1"
User value : (no user value)
Visibility : "y"
- Is choice item : false
- Is defined : true
- Is from env. : false
- Is special : false
+ Is choice item : False
+ Is defined : True
+ Is from env. : False
+ Is special : False
Ranges:
[1, 2] if !DUMMY (value: "y")
[INT, INT] if DUMMY (value: "n")
@@ -697,7 +697,7 @@ def run_selftests():
User value : (no user value)
Mode : "y"
Visibility : "y"
- Optional : false
+ Optional : False
Prompts:
"choice"
Defaults:
@@ -718,7 +718,7 @@ def run_selftests():
User value : CHOICE_ITEM_2
Mode : "y"
Visibility : "y"
- Optional : false
+ Optional : False
Prompts:
"choice"
Defaults: