aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/dump.py3
-rw-r--r--libmproxy/script.py6
2 files changed, 6 insertions, 3 deletions
diff --git a/libmproxy/dump.py b/libmproxy/dump.py
index cfc7c5da..88deb0d5 100644
--- a/libmproxy/dump.py
+++ b/libmproxy/dump.py
@@ -121,7 +121,8 @@ class DumpMaster(flow.FlowMaster):
not options.keepserving
)
- for script_argv in options.scripts:
+ scripts = options.scripts or []
+ for script_argv in scripts:
err = self.load_script(script_argv)
if err:
raise DumpError(err)
diff --git a/libmproxy/script.py b/libmproxy/script.py
index 4676672b..a7b774e6 100644
--- a/libmproxy/script.py
+++ b/libmproxy/script.py
@@ -46,10 +46,12 @@ class Script:
ns = {}
try:
execfile(path, ns, ns)
- self.ns = ns
- self.run("start", self.argv)
except Exception, v:
raise ScriptError(traceback.format_exc(v))
+ self.ns = ns
+ r = self.run("start", self.argv)
+ if not r[0] and r[1]:
+ raise ScriptError(r[1][1])
def unload(self):
return self.run("done")