[bitbake-devel] [PATCH 02/13] command: intercept SystemExit to avoid trashing the server

Paul Eggleton paul.eggleton at linux.intel.com
Mon Aug 17 11:12:17 UTC 2015

If sys.exit() is called within a command run over XMLRPC, the XMLRPC
server is effectively trashed (apparently listening but no longer able
to respond to commands). We need to intercept the SystemExit exception
and deal with it as we would any other exception.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
 lib/bb/command.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/command.py b/lib/bb/command.py
index 24ff341..a7cac97 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -71,7 +71,7 @@ class Command:
                 result = command_method(self, commandline)
             except CommandError as exc:
                 return None, exc.args[0]
-            except Exception:
+            except (Exception, SystemExit):
                 import traceback
                 return None, traceback.format_exc()

More information about the bitbake-devel mailing list