diff options
Diffstat (limited to 'libmproxy/flow.py')
-rw-r--r-- | libmproxy/flow.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libmproxy/flow.py b/libmproxy/flow.py index 6f57c1a6..f090d9c6 100644 --- a/libmproxy/flow.py +++ b/libmproxy/flow.py @@ -10,11 +10,9 @@ import os import re import urlparse - from netlib import wsgi from netlib.exceptions import HttpException from netlib.http import CONTENT_MISSING, Headers, http1 -import netlib.http from . import controller, tnetstring, filt, script, version from .onboarding import app from .proxy.config import HostMatcher @@ -642,7 +640,7 @@ class FlowMaster(controller.Master): self.stream = None self.apps = AppRegistry() - script.sig_script_change.connect(self.script_change) + script.script_change.connect(self.script_change) def start_app(self, host, port): self.apps.add( @@ -664,7 +662,7 @@ class FlowMaster(controller.Master): def unload_script(self, script_obj): try: script_obj.unload() - except script.ScriptError as e: + except script.ScriptException as e: self.add_event("Script error:\n" + str(e), "error") self.scripts.remove(script_obj) @@ -674,8 +672,8 @@ class FlowMaster(controller.Master): wrong. """ try: - s = script.Script(command, self) - except script.ScriptError as v: + s = script.Script(command, script.ScriptContext(self)) + except script.ScriptException as v: return v.args[0] self.scripts.append(s) @@ -683,7 +681,7 @@ class FlowMaster(controller.Master): if script_obj and not self.pause_scripts: try: script_obj.run(name, *args, **kwargs) - except script.ScriptError as e: + except script.ScriptException as e: self.add_event("Script error:\n" + str(e), "error") def run_script_hook(self, name, *args, **kwargs): |