diff options
author | Matthew Shao <me@matshao.com> | 2017-02-21 11:59:50 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-02-21 11:59:50 +0800 |
commit | f9714fbf3e595ba4c93ef036bfe63e3b63e256ab (patch) | |
tree | 68b6bb6cb55dd82a9424625d68dd9fedab9b001b | |
parent | 18401dda8f293434410fba066afe9235740be98b (diff) | |
download | mitmproxy-f9714fbf3e595ba4c93ef036bfe63e3b63e256ab.tar.gz mitmproxy-f9714fbf3e595ba4c93ef036bfe63e3b63e256ab.tar.bz2 mitmproxy-f9714fbf3e595ba4c93ef036bfe63e3b63e256ab.zip |
Fix #1928, @concurrent decorator now works for class methods.
-rw-r--r-- | mitmproxy/script/concurrent.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mitmproxy/script/concurrent.py b/mitmproxy/script/concurrent.py index 366929a5..87cdca96 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 |