scripts: handle SystemExit from scripts explicitly

This commit is contained in:
Aldo Cortesi
2016-10-16 11:34:27 +13:00
parent dc19ff7a9d
commit a6c7a1ff91

View File

@@ -88,6 +88,8 @@ def scriptenv(path, args):
sys.path.append(script_dir)
try:
yield
except SystemExit as v:
ctx.log.error("Script exited with code %s" % v.code)
except Exception:
etype, value, tb = sys.exc_info()
tb = cut_traceback(tb, "scriptenv").tb_next