Explicit return value from main
Rather than sometimes returning an integer, sometimes a boolean and
sometimes implicitly returning None, always return 0 for success and 1
for failure.
No behavior change for the program as a whole, since the None/True/False
values were implicitly converted to the desired numerical value.
Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
diff --git a/scripts/config.py b/scripts/config.py
index d6eb2e4..20521a5 100755
--- a/scripts/config.py
+++ b/scripts/config.py
@@ -452,7 +452,7 @@
value = config[args.symbol]
if value:
sys.stdout.write(value + '\n')
- return args.symbol not in config
+ return 0 if args.symbol in config else 1
elif args.command == 'set':
if not args.force and args.symbol not in config.settings:
sys.stderr.write("A #define for the symbol {} "
@@ -465,6 +465,7 @@
else:
config.adapt(args.adapter)
config.write(args.write)
+ return 0
# Import modules only used by main only if main is defined and called.
# pylint: disable=wrong-import-position