From e22a4dacf76fff5456573729084957a46658bb9d Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 24 Mar 2020 15:43:49 +0100 Subject: [PATCH] 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 --- scripts/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/config.py b/scripts/config.py index d6eb2e48c..20521a57a 100755 --- a/scripts/config.py +++ b/scripts/config.py @@ -452,7 +452,7 @@ if __name__ == '__main__': 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 @@ if __name__ == '__main__': 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