diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-13 14:03:48 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-08-13 14:03:48 (GMT) |
commit | 4a2b7a1b141fcbed6da81d942c9db776874c2fa9 (patch) | |
tree | 0288e22145e35c9d5d92c051800bf1c85e5858b8 /Doc | |
parent | b4b8eb916372dcb566740455122a28b5ed9631f9 (diff) | |
download | cpython-4a2b7a1b141fcbed6da81d942c9db776874c2fa9.zip cpython-4a2b7a1b141fcbed6da81d942c9db776874c2fa9.tar.gz cpython-4a2b7a1b141fcbed6da81d942c9db776874c2fa9.tar.bz2 |
Issue #9425: Create PyErr_WarnFormat() function
Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning
message.
Strip also some trailing spaces.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/exceptions.rst | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 619f0f6..fcbd50b 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:: |