From 6eae2bfd385fd7311aaa0f197f1a5060af5d7693 Mon Sep 17 00:00:00 2001 From: Yasushi SHOJI Date: Fri, 31 Oct 2025 02:09:50 +0900 Subject: scripts: kconfig: menuconfig: Ignore loc The commit 125d0daaa17aa added 'loc' to the sym.ranges tuples and fixed kconfiglib.py but menuconfig.py is left untouched. This make menuconfig to die with: Traceback (most recent call last): File ".../scripts/kconfig/menuconfig.py", line 3284, in _main() ~~~~~^^ File ".../scripts/kconfig/menuconfig.py", line 663, in _main menuconfig(standard_kconfig(__doc__)) ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".../scripts/kconfig/menuconfig.py", line 732, in menuconfig print(curses.wrapper(_menuconfig)) ~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper return func(stdscr, *args, **kwds) File ".../scripts/kconfig/menuconfig.py", line 872, in _menuconfig _change_node(sel_node) ~~~~~~~~~~~~^^^^^^^^^^ File ".../scripts/kconfig/menuconfig.py", line 1586, in _change_node s, _range_info(sc)) ~~~~~~~~~~~^^^^ File ".../scripts/kconfig/menuconfig.py", line 3119, in _range_info for low, high, cond in sym.ranges: ^^^^^^^^^^^^^^^ ValueError: too many values to unpack (expected 3) This commit ignores the last element in the tuples. Signed-off-by: Yasushi SHOJI --- menuconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index 9c5732a..178fbc1 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -3108,7 +3108,7 @@ def _check_valid(sym, s): .format(s, TYPE_TO_STR[sym.orig_type])) return False - for low_sym, high_sym, cond in sym.ranges: + for low_sym, high_sym, cond, _ in sym.ranges: if expr_value(cond): low_s = low_sym.str_value high_s = high_sym.str_value @@ -3128,7 +3128,7 @@ def _range_info(sym): # 'sym', or None if 'sym' doesn't have a range if sym.orig_type in (INT, HEX): - for low, high, cond in sym.ranges: + for low, high, cond, _ in sym.ranges: if expr_value(cond): return "Range: {}-{}".format(low.str_value, high.str_value) -- cgit v1.2.3