diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index c7e3cd9463e5d7..57b64ba5efd7f3 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -124,7 +124,10 @@ Raising exceptions These functions help you set the current thread's error indicator. For convenience, some of these functions will always return a -``NULL`` pointer for use in a ``return`` statement. +``NULL`` pointer for use in a ``return`` statement. Also, for all of the +functions in this subsection, if an exception has already been caught, +that exception will be implicitly chained (i.e. the last caught exception +will become the new exception's :attr:`~BaseException.__context__`). .. c:function:: void PyErr_SetString(PyObject *type, const char *message) diff --git a/Misc/NEWS.d/next/Documentation/2020-05-22-20-55-23.bpo-23188.Al3gI2.rst b/Misc/NEWS.d/next/Documentation/2020-05-22-20-55-23.bpo-23188.Al3gI2.rst new file mode 100644 index 00000000000000..14c0ce88090341 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2020-05-22-20-55-23.bpo-23188.Al3gI2.rst @@ -0,0 +1,2 @@ +Mention that :c:func:`PyErr_SetString`, :c:func:`PyErr_SetObject`, and +friends implicitly chain exceptions.