Skip to content

Commit 1ff1574

Browse files
committed
why do i forget to handle exceptions???
1 parent ff71f93 commit 1ff1574

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

iOS/testbed/__main__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,14 @@ async def run_testbed(simulator: str | None, args: list[str], catalyst: bool, ve
474474
finally:
475475
simulator_lock.release()
476476
else:
477-
async with asyncio.TaskGroup() as tg:
478-
tg.create_task(xcode_test(location, simulator="", verbose=verbose, catalyst=True))
477+
try:
478+
async with asyncio.TaskGroup() as tg:
479+
tg.create_task(xcode_test(location, simulator="", verbose=verbose, catalyst=True))
480+
except* MySystemExit as e:
481+
raise SystemExit(*e.exceptions[0].args) from None
482+
except* subprocess.CalledProcessError as e:
483+
# Extract it from the ExceptionGroup so it can be handled by `main`.
484+
raise e.exceptions[0]
479485

480486

481487
def main():

0 commit comments

Comments
 (0)