issue #121: fix call_function_test by not raising the dead

A first small mea culpa to all my testing sins of late :)
wip-fakessh-exit-status
David Wilson 7 years ago
parent f1009b7502
commit b243da087c

@ -294,7 +294,7 @@ class Message(object):
self.pickled(obj, dst_id=self.src_id, **kwargs) 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.""" """Deserialize `data` into an object."""
_vv and IOLOG.debug('%r.unpickle()', self) _vv and IOLOG.debug('%r.unpickle()', self)
fp = cStringIO.StringIO(self.data) fp = cStringIO.StringIO(self.data)
@ -308,7 +308,7 @@ class Message(object):
raise StreamError('invalid message: %s', ex) raise StreamError('invalid message: %s', ex)
if throw: if throw:
if obj == _DEAD: if obj == _DEAD and throw_dead:
raise ChannelError(ChannelError.remote_msg) raise ChannelError(ChannelError.remote_msg)
if isinstance(obj, CallError): if isinstance(obj, CallError):
raise obj raise obj

@ -609,7 +609,8 @@ class Context(mitogen.core.Context):
) )
def call(self, fn, *args, **kwargs): 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): class Router(mitogen.parent.Router):

Loading…
Cancel
Save