summaryrefslogtreecommitdiff
path: root/Doc/c-api/exceptions.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/exceptions.rst')
-rw-r--r--Doc/c-api/exceptions.rst13
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 619f0f6398..fcbd50ba7a 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -302,12 +302,12 @@ in various ways. There is a separate error indicator for each thread.
use.
-.. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stacklevel)
+.. cfunction:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
Issue a warning message. The *category* argument is a warning category (see
- below) or *NULL*; the *message* argument is a message string. *stacklevel* is a
+ below) or *NULL*; the *message* argument is a message string. *stack_level* is a
positive number giving a number of stack frames; the warning will be issued from
- the currently executing line of code in that stack frame. A *stacklevel* of 1
+ the currently executing line of code in that stack frame. A *stack_level* of 1
is the function calling :cfunc:`PyErr_WarnEx`, 2 is the function above that,
and so forth.
@@ -348,6 +348,13 @@ in various ways. There is a separate error indicator for each thread.
described there.
+.. cfunction:: int PyErr_WarnFormat(PyObject *category, Py_ssize_t stack_level, const char *format, ...)
+
+ Function similar to :cfunc:`PyErr_WarnEx`, but use
+ :cfunc:`PyUnicode_FromFormatV` to format the warning message.
+
+ .. versionadded:: 3.2
+
.. cfunction:: int PyErr_CheckSignals()
.. index::