From 5cd06810db85dd1f1ec232a2f2e457b20b8c186c Mon Sep 17 00:00:00 2001 From: goodboy Date: Thu, 7 May 2026 16:24:23 -0400 Subject: [PATCH] Tidy proto-guard `ValueError` fmt in `open_root_actor()` Pre-compute `mismatch_lines` str instead of `+`-concat inside the f-string raise site; slightly easier to read and avoids the `+ '\n\n'` continuation. (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-code --- tractor/_root.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tractor/_root.py b/tractor/_root.py index 29225957..3bfe7b9f 100644 --- a/tractor/_root.py +++ b/tractor/_root.py @@ -384,16 +384,17 @@ async def open_root_actor( if addr.proto_key not in enable_transports ] if bad_addrs: + mismatch_lines: str = '\n'.join( + f' - proto_key={pk!r} addr={a!r}' + for pk, a in bad_addrs + ) raise ValueError( f'`registry_addrs` contains addr(s) whose proto is ' f'not in `enable_transports`!\n' f'enable_transports: {enable_transports!r}\n' f'mismatched_addrs:\n' - + '\n'.join( - f' - proto_key={pk!r} addr={a!r}' - for pk, a in bad_addrs - ) - + '\n\n' + f'{mismatch_lines}\n' + f'\n' f'Either add the missing proto to ' f'`enable_transports`, or remove the addr from ' f'`registry_addrs`.'