issue #121: fix call_function_test by not raising the dead
A first small mea culpa to all my testing sins of late :)
This commit is contained in:
parent
f1009b7502
commit
b243da087c
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue