From 370c46b294db81ebf796c8c7ac29aaf37f4e1cb2 Mon Sep 17 00:00:00 2001 From: gunyu1019 Date: Fri, 15 Aug 2025 13:41:23 +0900 Subject: [PATCH 1/4] gh-137549: Modify object to BaseExceptionGroup --- Lib/asyncio/timeouts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/asyncio/timeouts.py b/Lib/asyncio/timeouts.py index 09342dc7c1310b..dff70354e42cd8 100644 --- a/Lib/asyncio/timeouts.py +++ b/Lib/asyncio/timeouts.py @@ -114,7 +114,7 @@ async def __aexit__( raise TimeoutError from exc_val elif exc_val is not None: self._insert_timeout_error(exc_val) - if isinstance(exc_val, ExceptionGroup): + if isinstance(exc_val, BaseExceptionGroup): for exc in exc_val.exceptions: self._insert_timeout_error(exc) elif self._state is _State.ENTERED: From a5ba083262b805583639cc36daf73cb4d4e15b39 Mon Sep 17 00:00:00 2001 From: gunyu1019 Date: Fri, 15 Aug 2025 14:13:03 +0900 Subject: [PATCH 2/4] Modify object to BaseGroupExceptionGroup --- .../next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst diff --git a/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst new file mode 100644 index 00000000000000..f558d59f1ea163 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst @@ -0,0 +1 @@ +Modify object to BaseGroupExceptionGroup From f60fb9a03f7cc80ae7ce99e13a1539506bc934ac Mon Sep 17 00:00:00 2001 From: gunyu1019 Date: Fri, 15 Aug 2025 15:02:24 +0900 Subject: [PATCH 3/4] Reflecting reviews. --- .../Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst index f558d59f1ea163..5d1f4edfcd00ef 100644 --- a/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst +++ b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst @@ -1 +1,2 @@ -Modify object to BaseGroupExceptionGroup +Modify `__aexit__` method of `asyncio.Timeout` class to handle the superclass of ExceptionGroup object. +Patch by gunyu1019. From df5e9d4ffaafbc488ecb01a1217710f74dd5ce8d Mon Sep 17 00:00:00 2001 From: gunyu1019 Date: Fri, 15 Aug 2025 15:06:30 +0900 Subject: [PATCH 4/4] Reflecting sphinx lint. --- .../next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst index 5d1f4edfcd00ef..859b99f63e7893 100644 --- a/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst +++ b/Misc/NEWS.d/next/Library/2025-08-15-14-12-29.gh-issue-137549.2DaXja.rst @@ -1,2 +1,2 @@ -Modify `__aexit__` method of `asyncio.Timeout` class to handle the superclass of ExceptionGroup object. +Modify ``__aexit__`` method of ``asyncio.Timeout`` class to handle the superclass of ExceptionGroup object. Patch by gunyu1019.