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>
This commit is contained in:
Chris Larson 2010-06-10 10:21:41 -07:00 committed by Richard Purdie
parent 562fd5f2a7
commit ef835bf33a
1 changed files with 10 additions and 1 deletions

View File

@ -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