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:
parent
562fd5f2a7
commit
ef835bf33a
|
@ -89,7 +89,16 @@ class Command:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
return False
|
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
|
import traceback
|
||||||
self.finishAsyncCommand(traceback.format_exc())
|
self.finishAsyncCommand(traceback.format_exc())
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue