diff options
Diffstat (limited to 'libmproxy/protocol2/layer.py')
-rw-r--r-- | libmproxy/protocol2/layer.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libmproxy/protocol2/layer.py b/libmproxy/protocol2/layer.py index aaa51baf..c18be83c 100644 --- a/libmproxy/protocol2/layer.py +++ b/libmproxy/protocol2/layer.py @@ -176,7 +176,7 @@ def yield_from_callback(fun): """ yield_queue = Queue.Queue() - def do_yield(self, msg): + def do_yield(msg): yield_queue.put(msg) yield_queue.get() @@ -192,14 +192,14 @@ def yield_from_callback(fun): threading.Thread(target=run, name="YieldFromCallbackThread").start() while True: - e = yield_queue.get() - if e is True: + msg = yield_queue.get() + if msg is True: break - elif isinstance(e, Exception): + elif isinstance(msg, Exception): # TODO: Include func name? - raise ProxyError2("Error from callback: " + repr(e), e) + raise ProxyError2("Error in %s: %s" % (fun.__name__, repr(msg)), msg) else: - yield e + yield msg yield_queue.put(None) self.yield_from_callback = None |