aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-06-05 14:15:51 +0200
committerGitHub <noreply@github.com>2024-06-05 12:15:51 +0000
commit8e0c80a4866c82e9841b787da654cb71dfc49341 (patch)
tree24214bca9f960d5555d9e61fe12ea4f0a4ebd0fb
parent[3.13] gh-119819: Update logging configuration to support joinable multiprocâ... (diff)
downloadcpython-8e0c80a4866c82e9841b787da654cb71dfc49341.tar.gz
cpython-8e0c80a4866c82e9841b787da654cb71dfc49341.tar.bz2
cpython-8e0c80a4866c82e9841b787da654cb71dfc49341.zip
[3.13] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (#120105)
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (cherry picked from commit 5c02ea8bae2287a828840f5734966da23dc573dc) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
-rw-r--r--Doc/library/contextlib.rst4
-rw-r--r--Doc/library/exceptions.rst3
2 files changed, 5 insertions, 2 deletions
diff --git a/Doc/library/contextlib.rst b/Doc/library/contextlib.rst
index bad9da52d6..27cf99446e 100644
--- a/Doc/library/contextlib.rst
+++ b/Doc/library/contextlib.rst
@@ -314,7 +314,9 @@ Functions and classes provided:
If the code within the :keyword:`!with` block raises a
:exc:`BaseExceptionGroup`, suppressed exceptions are removed from the
- group. If any exceptions in the group are not suppressed, a group containing them is re-raised.
+ group. Any exceptions of the group which are not suppressed are re-raised in
+ a new group which is created using the original group's :meth:`~BaseExceptionGroup.derive`
+ method.
.. versionadded:: 3.4
diff --git a/Doc/library/exceptions.rst b/Doc/library/exceptions.rst
index 7879fb015b..7910b306f1 100644
--- a/Doc/library/exceptions.rst
+++ b/Doc/library/exceptions.rst
@@ -989,7 +989,8 @@ their subgroups based on the types of the contained exceptions.
Returns an exception group with the same :attr:`message`, but which
wraps the exceptions in ``excs``.
- This method is used by :meth:`subgroup` and :meth:`split`. A
+ This method is used by :meth:`subgroup` and :meth:`split`, which
+ are used in various contexts to break up an exception group. A
subclass needs to override it in order to make :meth:`subgroup`
and :meth:`split` return instances of the subclass rather
than :exc:`ExceptionGroup`.