From 97b7b082ec4a48e0eea6c6f9e9543f940654cd09 Mon Sep 17 00:00:00 2001 From: Kevin Tewouda Date: Tue, 21 Nov 2023 10:28:02 +0100 Subject: [PATCH] Fixed ExceptionGroup example (#637) --- docs/tasks.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tasks.rst b/docs/tasks.rst index c7c359a1..bc7a4f7f 100644 --- a/docs/tasks.rst +++ b/docs/tasks.rst @@ -115,10 +115,10 @@ exceptions:: tg.start_soon(some_task) tg.start_soon(another_task) except* ValueError as excgroup: - for exc in excgroup: + for exc in excgroup.exceptions: ... # handle each ValueError except* KeyError as excgroup: - for exc in excgroup: + for exc in excgroup.exceptions: ... # handle each KeyError If compatibility with older Python versions is required, you can use the ``catch()``