Skip to content

Commit c9ac23c

Browse files
committed
Reword to contain a link to __context__
1 parent d60210d commit c9ac23c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/library/stdtypes.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5356,9 +5356,11 @@ before the statement body is executed and exited when the statement ends:
53565356
Returning a true value from this method will cause the :keyword:`with` statement
53575357
to suppress the exception and continue execution with the statement immediately
53585358
following the :keyword:`!with` statement. Otherwise the exception continues
5359-
propagating after this method has finished executing. Exceptions that occur
5360-
during execution of this method will be propagated on top of any exception that
5361-
occurred in the body of the :keyword:`!with` statement.
5359+
propagating after this method has finished executing.
5360+
5361+
If this method raises an exception while handling an earlier exception from the
5362+
:keyword:`with` block, the new exception is raised, and the original exception
5363+
is stored in its :attr:`~BaseException.__context__` attribute.
53625364

53635365
The exception passed in should never be reraised explicitly - instead, this
53645366
method should return a false value to indicate that the method completed

0 commit comments

Comments
 (0)