Improve main function

The main function is wrapped with a sys.exit function[1] which has an optional
argument but the current implementation doesn't return a value in case of a
successful execution. This change ensures that main function returns a value
consumed by sys.exit function.

[1] https://docs.python.org/3/library/sys.html#sys.exit

Change-Id: I3b65db9ce57e53b8696e417bcfbd52c67ddb0b89
This commit is contained in:
Victor Morales 2021-08-06 11:15:17 -07:00
parent 1ce4074043
commit 6027b173b9
1 changed files with 3 additions and 2 deletions

View File

@ -303,9 +303,10 @@ def main():
if args.debug:
raise
else:
sys.exit(str(exc))
return str(exc)
except KeyboardInterrupt:
sys.exit('Aborting by user request')
return 'Aborting by user request'
return 0
if __name__ == '__main__':