From c2b5a13e3f1cfd193184c2fca9df0d531501a8ab Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 14 Jun 2016 14:39:07 +1200 Subject: Don't fail when start() is not defined --- mitmproxy/script/script.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mitmproxy/script/script.py b/mitmproxy/script/script.py index 9d149f4d..9ff79f52 100644 --- a/mitmproxy/script/script.py +++ b/mitmproxy/script/script.py @@ -104,7 +104,7 @@ class Script(object): sys.path.pop() start_fn = self.ns.get("start") - if len(inspect.getargspec(start_fn).args) == 2: + if start_fn and len(inspect.getargspec(start_fn).args) == 2: warnings.warn( "The 'args' argument of the start() script hook is deprecated. " "Please use sys.argv instead." -- cgit v1.2.3