From 6120e99d7ec8a8721f1a1f96bd5df32f2f631158 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 27 Jul 2022 15:01:24 -0400 Subject: [PATCH] Rename `._error` -> `._remote_ctx_error` --- tractor/_runtime.py | 4 ++-- tractor/_streaming.py | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tractor/_runtime.py b/tractor/_runtime.py index 707b9dd..c98870e 100644 --- a/tractor/_runtime.py +++ b/tractor/_runtime.py @@ -199,8 +199,8 @@ async def _invoke( except BaseExceptionGroup: # if a context error was set then likely # thei multierror was raised due to that - if ctx._error is not None: - raise ctx._error from None + if ctx._remote_ctx_error is not None: + raise ctx._remote_ctx_error from None raise diff --git a/tractor/_streaming.py b/tractor/_streaming.py index 8b98449..d5cd2d7 100644 --- a/tractor/_streaming.py +++ b/tractor/_streaming.py @@ -342,8 +342,8 @@ class MsgStream(trio.abc.Channel): Send a message over this stream to the far end. ''' - if self._ctx._error: - raise self._ctx._error # from None + if self._ctx._remote_ctx_error: + raise self._ctx._remote_ctx_error # from None if self._closed: raise trio.ClosedResourceError('This stream was already closed') @@ -385,7 +385,7 @@ class Context: _portal: Optional[Portal] = None # type: ignore # noqa _stream: Optional[MsgStream] = None _result: Optional[Any] = False - _error: Optional[BaseException] = None + _remote_ctx_error: Optional[BaseException] = None # status flags _cancel_called: bool = False @@ -462,7 +462,7 @@ class Context: f'{msg["error"]["tb_str"]}' ) - self._error = error + self._remote_ctx_error = error # TODO: tempted to **not** do this by-reraising in a # nursery and instead cancel a surrounding scope, detect @@ -470,7 +470,7 @@ class Context: if self._scope_nursery: async def raiser(): - raise self._error from None + raise self._remote_ctx_error from None # from trio.testing import wait_all_tasks_blocked # await wait_all_tasks_blocked()