@@ -587,7 +587,7 @@ printed::
587587 ...
588588 Traceback (most recent call last):
589589 File "<stdin>", line 2, in <module>
590- ZeroDivisionError: int division or modulo by zero
590+ ZeroDivisionError: division by zero
591591
592592 The above exception was the direct cause of the following exception:
593593
@@ -606,17 +606,35 @@ attached as the new exception's :attr:`__context__` attribute::
606606 ...
607607 Traceback (most recent call last):
608608 File "<stdin>", line 2, in <module>
609- ZeroDivisionError: int division or modulo by zero
609+ ZeroDivisionError: division by zero
610610
611611 During handling of the above exception, another exception occurred:
612612
613613 Traceback (most recent call last):
614614 File "<stdin>", line 4, in <module>
615615 RuntimeError: Something bad happened
616616
617+ Exception chaining can be explicitly suppressed by specifying :const: `None ` in
618+ the ``from `` clause::
619+
620+ >>> try:
621+ ... print(1 / 0)
622+ ... except:
623+ ... raise RuntimeError("Something bad happened") from None
624+ ...
625+ Traceback (most recent call last):
626+ File "<stdin>", line 4, in <module>
627+ RuntimeError: Something bad happened
628+
617629Additional information on exceptions can be found in section :ref: `exceptions `,
618630and information about handling exceptions is in section :ref: `try `.
619631
632+ .. versionchanged :: 3.3
633+ :const: `None ` is now permitted as ``Y `` in ``raise X from Y ``
634+
635+ .. versionadded :: 3.3
636+ The ``__suppress_context__ `` attribute to suppress automatic display of the
637+ exception context
620638
621639.. _break :
622640
0 commit comments