Skip to content

Commit e181e1b

Browse files
ulfalizernashif
authored andcommitted
kconfiglib: Update to hide tracebacks for expected errors
Update Kconfiglib to upstream revision 9c0b562c94 to get this commit in: Add Kconfig.__init__() helper flag for suppressing tracebacks Tools that don't use standard_kconfig() currently generate spammy tracebacks for e.g. syntax errors. Add a suppress_traceback flag to Kconfig.__init__() for catching "expected" exceptions and printing them to stderr and exiting with status 1. Use it to make all tools consistently hide tracebacks. Use the new flag to hide tracebacks for expected exceptions in kconfig.py, lint.py, and genrest.py. Some menuconfig robustness tweaks for wonky terminals are included as well, and a new feature for customizing .config and autoconf.h header comments via environment variables. Signed-off-by: Ulf Magnusson <[email protected]>
1 parent 6118ca2 commit e181e1b

File tree

5 files changed

+221
-141
lines changed

5 files changed

+221
-141
lines changed

doc/scripts/genrest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def init():
105105

106106
args = parse_args()
107107

108-
kconf = kconfiglib.Kconfig(args.kconfig)
108+
kconf = kconfiglib.Kconfig(args.kconfig, suppress_traceback=True)
109109
out_dir = args.out_dir
110110
index_desc = args.index_desc
111111
separate_all_index = args.separate_all_index

scripts/kconfig/kconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def main():
2929
args = parse_args()
3030

3131
print("Parsing Kconfig tree in " + args.kconfig_root)
32-
kconf = Kconfig(args.kconfig_root, warn_to_stderr=False)
32+
kconf = Kconfig(args.kconfig_root, warn_to_stderr=False,
33+
suppress_traceback=True)
3334

3435
# Warn for assignments to undefined symbols
3536
kconf.warn_assign_undef = True

0 commit comments

Comments
 (0)