From 7a531ea22b3f1971b9b0c38271f66a218003b5f6 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Sat, 16 Nov 2019 05:08:24 +0100 Subject: [PATCH] scripts: kconfig.py: Use err() helper for warnings-turned-errors De-spams the code a bit. Signed-off-by: Ulf Magnusson --- scripts/kconfig/kconfig.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/kconfig/kconfig.py b/scripts/kconfig/kconfig.py index a16f37a9b24..9567b67b818 100755 --- a/scripts/kconfig/kconfig.py +++ b/scripts/kconfig/kconfig.py @@ -91,13 +91,10 @@ def main(): # now as well. for warning in kconf.warnings: if fatal(warning): - sys.exit("\n" + textwrap.fill( - "Error: Aborting due to non-whitelisted Kconfig " - "warning '{}'.\nNote: If this warning doesn't point " - "to an actual problem, you can add it to the " - "whitelist at the top of {}." - .format(warning, sys.argv[0]), - 100) + "\n") + err("""\ +Aborting due to non-whitelisted Kconfig warning '{}'. If this warning doesn't +point to an actual problem, you can add it to the whitelist at the top of {}.\ +""".format(warning, sys.argv[0])) # Write the merged configuration and the C header print(kconf.write_config(args.dotconfig))