From f9714fbf3e595ba4c93ef036bfe63e3b63e256ab Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Tue, 21 Feb 2017 11:59:50 +0800 Subject: [PATCH] Fix #1928, @concurrent decorator now works for class methods. --- mitmproxy/script/concurrent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mitmproxy/script/concurrent.py b/mitmproxy/script/concurrent.py index 366929a5d..87cdca968 100644 --- a/mitmproxy/script/concurrent.py +++ b/mitmproxy/script/concurrent.py @@ -29,4 +29,7 @@ def concurrent(fn): "script.concurrent (%s)" % fn.__name__, target=run ).start() - return _concurrent + if "." in fn.__qualname__: + return staticmethod(_concurrent) + else: + return _concurrent