Commit b243da08 authored by David Wilson's avatar David Wilson

issue #121: fix call_function_test by not raising the dead

A first small mea culpa to all my testing sins of late :)
parent f1009b75
......@@ -294,7 +294,7 @@ class Message(object):
self.pickled(obj, dst_id=self.src_id, **kwargs)
)
def unpickle(self, throw=True):
def unpickle(self, throw=True, throw_dead=True):
"""Deserialize `data` into an object."""
_vv and IOLOG.debug('%r.unpickle()', self)
fp = cStringIO.StringIO(self.data)
......@@ -308,7 +308,7 @@ class Message(object):
raise StreamError('invalid message: %s', ex)
if throw:
if obj == _DEAD:
if obj == _DEAD and throw_dead:
raise ChannelError(ChannelError.remote_msg)
if isinstance(obj, CallError):
raise obj
......
......@@ -609,7 +609,8 @@ class Context(mitogen.core.Context):
)
def call(self, fn, *args, **kwargs):
return self.call_async(fn, *args, **kwargs).get().unpickle()
receiver = self.call_async(fn, *args, **kwargs)
return receiver.get().unpickle(throw_dead=False)
class Router(mitogen.parent.Router):
......
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