Commit 3261c561 authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

Fix AttributeError in mitogen.core.Context.send_await()

As of adc8fe3aed470de55a6e5ea3d7c6a31f7c6d1ff1 Receiver objects do not
have a get_data() method and Receiver.get() does not unpickle the
message.
parent fa0f390d
......@@ -769,9 +769,10 @@ class Context(object):
def send_await(self, msg, deadline=None):
"""Send `msg` and wait for a response with an optional timeout."""
receiver = self.send_async(msg)
response = receiver.get_data(deadline)
IOLOG.debug('%r._send_await() -> %r', self, response)
return response
response = receiver.get(deadline)
data = response.unpickle()
IOLOG.debug('%r._send_await() -> %r', self, data)
return data
def __repr__(self):
return 'Context(%s, %r)' % (self.context_id, self.name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment