diff options
| -rw-r--r-- | kconfiglib.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/kconfiglib.py b/kconfiglib.py index db45ac9..da6d144 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -1453,12 +1453,10 @@ class Config(object): return "y" if (ev == "n") else "m" if first_expr == EQUAL: - return "y" if (_get_str_value(expr[1]) == - _get_str_value(expr[2])) else "n" + return "y" if (_str_val(expr[1]) == _str_val(expr[2])) else "n" if first_expr == UNEQUAL: - return "y" if (_get_str_value(expr[1]) != - _get_str_value(expr[2])) else "n" + return "y" if (_str_val(expr[1]) != _str_val(expr[2])) else "n" _internal_error("Internal error while evaluating expression: " "unknown operation {0}.".format(first_expr)) @@ -1864,7 +1862,7 @@ def _get_expr_syms(expr): rec(expr) return res -def _get_str_value(obj): +def _str_val(obj): """Returns the value of obj as a string. If obj is not a string (constant symbol), it must be a Symbol.""" return obj if isinstance(obj, str) else obj.get_value() @@ -2176,7 +2174,7 @@ class Symbol(Item, _HasVisibility): for val_expr, cond_expr in self.def_exprs: if self.config._eval_expr(cond_expr) != "n": self.write_to_conf = True - new_val = _get_str_value(val_expr) + new_val = _str_val(val_expr) break elif self.type == HEX or self.type == INT: @@ -2191,8 +2189,8 @@ class Symbol(Item, _HasVisibility): if self.config._eval_expr(cond_expr) != "n": has_active_range = True - low_str = _get_str_value(l) - high_str = _get_str_value(h) + low_str = _str_val(l) + high_str = _str_val(h) low = int(low_str, base) if \ _is_base_n(low_str, base) else 0 high = int(high_str, base) if \ @@ -2225,7 +2223,7 @@ class Symbol(Item, _HasVisibility): # to the range, and the output has "0x" as appropriate # for the type. - new_val = _get_str_value(val_expr) + new_val = _str_val(val_expr) if _is_base_n(new_val, base): new_val_num = int(new_val, base) |
