From d60210d318f3ed5686da39882bd867f8685bb0db Mon Sep 17 00:00:00 2001 From: bswck Date: Wed, 15 Oct 2025 17:43:50 +0200 Subject: [PATCH] Mention exception chaining in `contextmanager.__exit__` --- Doc/library/stdtypes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 2c5b721093d5c0..552e008f58891d 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -5357,8 +5357,8 @@ before the statement body is executed and exited when the statement ends: to suppress the exception and continue execution with the statement immediately following the :keyword:`!with` statement. Otherwise the exception continues propagating after this method has finished executing. Exceptions that occur - during execution of this method will replace any exception that occurred in the - body of the :keyword:`!with` statement. + during execution of this method will be propagated on top of any exception that + occurred in the body of the :keyword:`!with` statement. The exception passed in should never be reraised explicitly - instead, this method should return a false value to indicate that the method completed