scripts: kconfig.py: Use err() helper for warnings-turned-errors

De-spams the code a bit.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
Ulf Magnusson 2019-11-16 05:08:24 +01:00 committed by Carles Cufí
commit 7a531ea22b

View file

@ -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))