aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/master.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-04-02 15:47:23 +1200
committerAldo Cortesi <aldo@nullcube.com>2018-04-02 16:41:49 +1200
commit14f461c5d59e95e84658ea43567b3ca9f7d0a108 (patch)
tree1e76216ac2a1a86c237dee2e1ed89cba87224cb1 /mitmproxy/master.py
parent1f33c1c1a54e466f903cc69a2e086d699515cad8 (diff)
downloadmitmproxy-14f461c5d59e95e84658ea43567b3ca9f7d0a108.tar.gz
mitmproxy-14f461c5d59e95e84658ea43567b3ca9f7d0a108.tar.bz2
mitmproxy-14f461c5d59e95e84658ea43567b3ca9f7d0a108.zip
asyncio: cleanup and lint
Also fix a racy websocket test.
Diffstat (limited to 'mitmproxy/master.py')
-rw-r--r--mitmproxy/master.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mitmproxy/master.py b/mitmproxy/master.py
index 022590d4..372bb289 100644
--- a/mitmproxy/master.py
+++ b/mitmproxy/master.py
@@ -85,7 +85,8 @@ class Master:
mitmproxy_ctx.log = None
mitmproxy_ctx.options = None
- def tell(self, mtype, m):
+ # This is a vestigial function that will go away in a refactor very soon
+ def tell(self, mtype, m): # pragma: no cover
m.reply = controller.DummyReply()
self.event_queue.put((mtype, m))
@@ -106,7 +107,7 @@ class Master:
mtype, obj = await self.event_queue.get()
except RuntimeError:
return
- if mtype not in eventsequence.Events:
+ if mtype not in eventsequence.Events: # pragma: no cover
raise exceptions.ControlException("Unknown event %s" % repr(mtype))
self.addons.handle_lifecycle(mtype, obj)
self.event_queue.task_done()