Patchwork [bitbake-devel] cooker: updateCache should rause exceptions, not sys.exit

mail settings
Submitter Richard Purdie
Date Sept. 13, 2013, 4:34 p.m.
Message ID <1379090082.3484.277.camel@ted>
Download mbox | patch
Permalink /patch/57987/
State New
Headers show


Richard Purdie - Sept. 13, 2013, 4:34 p.m.
Exiting from the server is antisocial, instead we should raise an exception. This
will correctly fail the current command and reset the server state. We use
the handled exception since for these conditions to occur, something was
already displayed to the user.

Signed-off-by: Richard Purdie <>


diff --git a/bitbake/lib/bb/ b/bitbake/lib/bb/
index 0a4dc7e..a07615b 100644
--- a/bitbake/lib/bb/
+++ b/bitbake/lib/bb/
@@ -1172,7 +1172,7 @@  class BBCooker:
         if self.state in (state.shutdown, state.forceshutdown):
             self.parser.shutdown(clean=False, force = True)
-            sys.exit(1)
+            raise bb.BBHandledException()
         if self.state != state.parsing:
             self.parseConfiguration ()
@@ -1194,7 +1194,7 @@  class BBCooker:
         if not self.parser.parse_next():
             collectlog.debug(1, "parsing complete")
             if self.parser.error:
-                sys.exit(1)
+                raise bb.BBHandledException()
             self.recipecache.bbfile_priority = self.collection.collection_priorities(self.recipecache.pkg_fn)