Openembedded Bitbake Development
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: bitbake-devel@lists.openembedded.org
Subject: [PATCH] bitbake: use sys.exit to simplify the code
Date: Tue, 28 Apr 2015 15:52:18 +0300	[thread overview]
Message-ID: <1430225538-15639-1-git-send-email-ed.bartosh@linux.intel.com> (raw)

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>
---
 bitbake/bin/bitbake | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/bitbake/bin/bitbake b/bitbake/bin/bitbake
index 88ac8c3..b6f19ef 100755
--- a/bitbake/bin/bitbake
+++ b/bitbake/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)
-- 
2.1.4



                 reply	other threads:[~2015-04-28 12:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1430225538-15639-1-git-send-email-ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=bitbake-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox