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

As of adc8fe3aed Receiver objects do not
have a get_data() method and Receiver.get() does not unpickle the
message.
wip-fakessh-exit-status
Alex Willmer 7 years ago committed by David Wilson
parent fa0f390d4d
commit 3261c561dd

@ -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)

Loading…
Cancel
Save