Hide some portal stack layers in tracebacks
parent
1b7cd419f2
commit
5df08aabb7
|
@ -65,16 +65,15 @@ def _trio_main(
|
||||||
parent_addr: Tuple[str, int] = None,
|
parent_addr: Tuple[str, int] = None,
|
||||||
infect_asyncio: bool = False,
|
infect_asyncio: bool = False,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Entry point for a `trio_run_in_process` subactor.
|
|
||||||
"""
|
"""
|
||||||
# Disable sigint handling in children;
|
Entry point for a `trio_run_in_process` subactor.
|
||||||
# we don't need it thanks to our cancellation machinery.
|
|
||||||
|
"""
|
||||||
|
log.info(f"Started new trio process for {actor.uid}")
|
||||||
|
|
||||||
|
# Disable sigint handling in children?
|
||||||
# signal.signal(signal.SIGINT, signal.SIG_IGN)
|
# signal.signal(signal.SIGINT, signal.SIG_IGN)
|
||||||
|
|
||||||
log.info(f"Started new trio process for {actor.uid}")
|
|
||||||
|
|
||||||
log.info(f"Started new trio process for {actor.uid}")
|
|
||||||
|
|
||||||
if actor.loglevel is not None:
|
if actor.loglevel is not None:
|
||||||
log.info(
|
log.info(
|
||||||
f"Setting loglevel for {actor.uid} to {actor.loglevel}")
|
f"Setting loglevel for {actor.uid} to {actor.loglevel}")
|
||||||
|
|
|
@ -129,6 +129,7 @@ class Portal:
|
||||||
resptype: str,
|
resptype: str,
|
||||||
first_msg: dict
|
first_msg: dict
|
||||||
) -> Any:
|
) -> Any:
|
||||||
|
__tracebackhide__ = True
|
||||||
assert resptype == 'asyncfunc' # single response
|
assert resptype == 'asyncfunc' # single response
|
||||||
|
|
||||||
msg = await recv_chan.receive()
|
msg = await recv_chan.receive()
|
||||||
|
@ -140,8 +141,11 @@ class Portal:
|
||||||
raise unpack_error(msg, self.channel)
|
raise unpack_error(msg, self.channel)
|
||||||
|
|
||||||
async def result(self) -> Any:
|
async def result(self) -> Any:
|
||||||
"""Return the result(s) from the remote actor's "main" task.
|
|
||||||
"""
|
"""
|
||||||
|
Return the result(s) from the remote actor's "main" task.
|
||||||
|
|
||||||
|
"""
|
||||||
|
__tracebackhide__ = True
|
||||||
# Check for non-rpc errors slapped on the
|
# Check for non-rpc errors slapped on the
|
||||||
# channel for which we always raise
|
# channel for which we always raise
|
||||||
exc = self.channel._exc
|
exc = self.channel._exc
|
||||||
|
|
Loading…
Reference in New Issue