summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2015-04-28 15:52:18 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-04-28 17:48:32 +0100
commit5ecb8817bd49223652ede4fe513f1a42f2196798 (patch)
tree5622147a6afe5817577bd18fc0fe1f1d0ac165b7 /bin
parent2fe7d8c574ddf6a30278cff1a5a5c4089dc56d6d (diff)
downloadbitbake-5ecb8817bd49223652ede4fe513f1a42f2196798.zip
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. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/bitbake13
1 files changed, 5 insertions, 8 deletions
diff --git a/bin/bitbake b/bin/bitbake
index 88ac8c34..b6f19ef2 100755
--- a/bin/bitbake
+++ b/bin/bitbake
@@ -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)