Using sys.exit(main()) instead of main()

As we known, Exceptions are raised by the sys.exit() function.
When they are not handled, no stack traceback is printed in the Python interpreter.

In this patch we have known main() got return values(eg:0, 1), but it can't
specifies exit status when terminate the main thread by unusing sys.exit().
So when using sys.exit(main()) instead of main() may be more readable and reasonable.

Change-Id: Ia0737272aaa943b2ecab38ae292c8539e77e8723
This commit is contained in:
gecong1973 2016-12-28 11:13:02 +08:00
parent 53dee2cf61
commit 39d6562717
1 changed files with 1 additions and 1 deletions

View File

@ -68,4 +68,4 @@ def main(argv):
print_help(venv, root)
if __name__ == '__main__':
main(sys.argv)
sys.exit(main(sys.argv))