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:
onyx-and-iris 2025-06-13 14:04:05 +01:00
parent f282f86e72
commit f4421b3351
6 changed files with 32 additions and 32 deletions

View File

@ -86,8 +86,8 @@ async def mute(ctx: click.Context, source_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@audio.command() @audio.command()
@ -117,8 +117,8 @@ async def unmute(ctx: click.Context, source_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@audio.command() @audio.command()
@ -151,8 +151,8 @@ async def toggle(ctx: click.Context, source_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@audio.command() @audio.command()
@ -182,5 +182,5 @@ async def status(ctx: click.Context, source_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable

View File

@ -38,8 +38,8 @@ async def start(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@record.command() @record.command()
@ -67,8 +67,8 @@ async def stop(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@record.command() @record.command()

View File

@ -37,8 +37,8 @@ async def start(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@replaybuffer.command() @replaybuffer.command()
@ -65,8 +65,8 @@ async def stop(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@replaybuffer.command() @replaybuffer.command()

View File

@ -88,8 +88,8 @@ async def load(ctx: click.Context, scenecollection_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@scenecollection.command() @scenecollection.command()
@ -136,8 +136,8 @@ async def delete(ctx: click.Context, scenecollection_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@scenecollection.command() @scenecollection.command()
@ -169,5 +169,5 @@ async def rename(ctx: click.Context, scenecollection_name: str, new_name: str):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable

View File

@ -37,8 +37,8 @@ async def start(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@stream.command() @stream.command()
@ -65,8 +65,8 @@ async def stop(ctx: click.Context):
tg.start_soon(conn.background_processing) tg.start_soon(conn.background_processing)
tg.start_soon(_run) tg.start_soon(_run)
except* SlobsCliError as excgroup: except* SlobsCliError as excgroup:
for e in excgroup.exceptions: raisable = next(iter(excgroup.exceptions))
raise e raise raisable
@stream.command() @stream.command()

View File

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