bpo-23188: Document that PyErr_SetString, etc. chains exceptions

This commit is contained in:
Chris Jerdonek 2020-05-22 21:06:40 -07:00
parent af23f0d3cf
commit fc68664d90
2 changed files with 6 additions and 1 deletions

View File

@ -92,7 +92,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:`__context__`).
.. c:function:: void PyErr_SetString(PyObject *type, const char *message)

View File

@ -0,0 +1,2 @@
Mention that :c:func:`PyErr_SetString`, :c:func:`PyErr_SetObject`, and
friends implicitly chain exceptions.