diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-06-10 10:21:41 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-07-02 15:41:36 +0100 |
commit | ef835bf33a9c5bddb5b3c7951178f86ed29a37f4 (patch) | |
tree | 9f2e8a6d0daa133d0bc7f564ca27f99166949c9f /bitbake/lib | |
parent | 562fd5f2a72f8e4925bf2f14cb5fbd015c591b4f (diff) | |
download | openembedded-core-ef835bf33a9c5bddb5b3c7951178f86ed29a37f4.tar.gz openembedded-core-ef835bf33a9c5bddb5b3c7951178f86ed29a37f4.tar.bz2 openembedded-core-ef835bf33a9c5bddb5b3c7951178f86ed29a37f4.zip |
Handle SystemExit and KeyboardInterrupt sanely when executing a command
(Bitbake rev: 17f40d036814e4abf6d87363fff7823c8c85c298)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib')
-rw-r--r-- | bitbake/lib/bb/command.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py index a590e61abe..32d5b5bab6 100644 --- a/bitbake/lib/bb/command.py +++ b/bitbake/lib/bb/command.py @@ -89,7 +89,16 @@ class Command: return False else: return False - except: + except KeyboardInterrupt as exc: + self.finishAsyncCommand("Interrupted") + return False + except SystemExit as exc: + arg = exc.args[0] + if isinstance(arg, basestring): + self.finishAsyncCommand(arg) + else: + self.finishAsyncCommand("Exited with %s" % arg) + except Exception: import traceback self.finishAsyncCommand(traceback.format_exc()) return False |