mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-03-27 17:34:55 +08:00
scripts: handle SystemExit from scripts explicitly
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user