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 authored and Richard Purdie committed 2010-07-02 15:41:36 +01:00
1 parent 562fd5f2a7
commit ef835bf33a
1 file changed
+10 -1
+10 -1
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