tractor/tractor
Tyler Goodlet f7cd8739a5 Accept err-type override in `is_multi_cancelled()`
Such that equivalents of `trio.Cancelled` from other runtimes such as
`asyncio.CancelledError` and `subprocess.CalledProcessError` (with
a `.returncode == -2`) can be gracefully ignored as needed by the
caller.

For example this is handy if you want to avoid debug-mode REPL entry on
an exception-group full of only some subset of exception types since you
expect certain tasks to raise such errors after having been cancelled by
a request from some parent supervision sys (some "higher up"
`trio.CancelScope`, a remote triggered `ContextCancelled` or just from
and OS SIGINT).

Impl deats,
- offer a new `ignore_nested: set[BaseException]` param which by
  default we add `trio.Cancelled` to when no other types are provided.
- use `ExceptionGroup.subgroup(tuple(ignore_nested)` to filter to egs of
  the "ignored sub-errors set" and return any such match (instead of
  `True`).
- detail a comment on exclusion case.
2025-03-10 12:04:51 -04:00
..
_testing Move `mk_cmd()` to `._testing` 2024-07-10 15:40:44 -04:00
devx Add TODO for a tb frame "filterer" sys.. 2024-12-09 17:14:51 -05:00
experimental Drop now-deprecated deps on modern `trio`/Python 2024-03-13 18:41:24 -04:00
msg Draft a (pretty)`Struct.fields_diff()` 2024-12-10 14:12:37 -05:00
trionics Change masked `.pause()` line 2024-12-09 18:04:32 -05:00
__init__.py Finally implement peer-lookup optimization.. 2024-07-04 19:40:11 -04:00
_child.py Hide `._entry`/`._child` frames, tweak some more type annots 2024-04-14 17:49:18 -04:00
_clustering.py Passthrough runtime kwargs from `open_actor_cluster()` 2022-12-11 19:56:08 -05:00
_context.py Change masked `.pause()` line 2024-12-09 18:04:32 -05:00
_discovery.py Finally implement peer-lookup optimization.. 2024-07-04 19:40:11 -04:00
_entry.py Pass `infect_asyncio` setting via runtime-vars 2024-07-11 13:22:53 -04:00
_exceptions.py Accept err-type override in `is_multi_cancelled()` 2025-03-10 12:04:51 -04:00
_forkserver_override.py Re-license code base for distribution under AGPL 2021-12-14 23:33:27 -05:00
_ipc.py More formal `TransportClosed` reporting/raising 2024-07-02 12:21:26 -04:00
_mp_fixup_main.py Avoid importing mp for as long as possible 2022-02-17 11:55:26 -05:00
_multiaddr.py Fix doc string "its" typo.. 2023-11-06 15:44:21 -05:00
_portal.py More-n-more scops annots in logging 2024-07-04 15:06:15 -04:00
_root.py Support and test infected-`asyncio`-mode for root 2025-03-10 12:04:51 -04:00
_rpc.py More formal `TransportClosed` reporting/raising 2024-07-02 12:21:26 -04:00
_runtime.py Denoise duplicate chan logging for now 2024-12-09 17:36:52 -05:00
_shm.py Drop now-deprecated deps on modern `trio`/Python 2024-03-13 18:41:24 -04:00
_spawn.py Use `._entry` proto-ed "lifetime ops" in logging 2024-07-02 16:31:58 -04:00
_state.py Pass `infect_asyncio` setting via runtime-vars 2024-07-11 13:22:53 -04:00
_streaming.py Reraise RAEs in `MsgStream.receive()`; truncate tbs 2024-07-02 16:31:15 -04:00
_supervise.py Add `tb_hide: bool` ctl flag to `_open_and_supervise_one_cancels_all_nursery()` 2024-08-22 17:22:53 -04:00
log.py Support passing pre-conf-ed `Logger` 2025-03-10 12:04:51 -04:00
to_asyncio.py Support and test infected-`asyncio`-mode for root 2025-03-10 12:04:51 -04:00