bitbake: bitbake: use sys.exit to simplify the code

Used sys.exit instead of assigning exit code to
variable. This way it's more clear when bitbake
exists and which exit code is used.

(Bitbake rev: 5ecb8817bd49223652ede4fe513f1a42f2196798)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh 2015-04-28 15:52:18 +03:00 committed by Richard Purdie
parent 37e46e49dd
commit 4eeae70a45
1 changed files with 5 additions and 8 deletions

View File

@ -41,16 +41,13 @@ if __name__ == "__main__":
if __version__ != bb.__version__:
sys.exit("Bitbake core version and program version mismatch!")
try:
ret = bitbake_main(BitBakeConfigParameters(sys.argv),
cookerdata.CookerConfiguration())
sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
cookerdata.CookerConfiguration()))
except BBMainException as err:
print >>sys.stderr, err
ret = 1
sys.exit(err)
except bb.BBHandledException:
ret = 1
sys.exit(1)
except Exception:
ret = 1
import traceback
traceback.print_exc()
sys.exit(ret)
sys.exit(1)