mirror of
https://github.com/python/cpython.git
synced 2025-10-28 17:13:08 +00:00
Issue #9425: Create PyErr_WarnFormat() function
Similar to PyErr_WarnEx() but use PyUnicode_FromFormatV() to format the warning message. Strip also some trailing spaces.
This commit is contained in:
parent
b4b8eb9163
commit
4a2b7a1b14
7 changed files with 74 additions and 34 deletions
|
|
@ -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::
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue