From 675eb6abafa6489587f63dd536a664f94bc7d276 Mon Sep 17 00:00:00 2001 From: gecong1973 Date: Wed, 28 Dec 2016 14:35:04 +0800 Subject: [PATCH] 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: I6b472e0eb2fceb49bb506785f5188e023e1d3968 --- fuel_agent/cmd/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fuel_agent/cmd/agent.py b/fuel_agent/cmd/agent.py index 2220ea39..6da1001a 100644 --- a/fuel_agent/cmd/agent.py +++ b/fuel_agent/cmd/agent.py @@ -147,4 +147,4 @@ def main(actions=None): if __name__ == '__main__': - main() + sys.exit(main())