call next(iter()) on excgroup.exceptions to convery intent a little better

(we dont intend to iterate through them, we just want to raise the first one)
This commit is contained in:
2025-06-13 14:04:05 +01:00
parent f282f86e72
commit f4421b3351
6 changed files with 32 additions and 32 deletions

View File

@@ -35,8 +35,8 @@ async def enable(ctx: click.Context):
tg.start_soon(conn.background_processing)
tg.start_soon(_run)
except* SlobsCliError as excgroup:
for e in excgroup.exceptions:
raise e
raisable = next(iter(excgroup.exceptions))
raise raisable
@studiomode.command()
@@ -61,8 +61,8 @@ async def disable(ctx: click.Context):
tg.start_soon(conn.background_processing)
tg.start_soon(_run)
except* SlobsCliError as excgroup:
for e in excgroup.exceptions:
raise e
raisable = next(iter(excgroup.exceptions))
raise raisable
@studiomode.command()
@@ -129,5 +129,5 @@ async def force_transition(ctx: click.Context):
tg.start_soon(conn.background_processing)
tg.start_soon(_run)
except* SlobsCliError as excgroup:
for e in excgroup.exceptions:
raise e
raisable = next(iter(excgroup.exceptions))
raise raisable