From 1ec91703ecdb4c369212fabe2ca0a68f040b7697 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 14 Dec 2019 18:04:09 +0100 Subject: 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. --- defconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'defconfig.py') diff --git a/defconfig.py b/defconfig.py index d1b1e4e..173fc7b 100755 --- a/defconfig.py +++ b/defconfig.py @@ -34,7 +34,7 @@ def main(): args = parser.parse_args() - kconf = kconfiglib.Kconfig(args.kconfig) + kconf = kconfiglib.Kconfig(args.kconfig, suppress_traceback=True) print(kconf.load_config(args.config)) print(kconf.write_config()) -- cgit v1.2.3