]> granicus.if.org Git - python/commitdiff
merge with 3.4
authorGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 10:58:36 +0000 (12:58 +0200)
committerGeorg Brandl <georg@python.org>
Mon, 6 Oct 2014 10:58:36 +0000 (12:58 +0200)
1  2 
Doc/c-api/exceptions.rst

index d0d4906a5835c06b453ccc5df352c7effeda2d7d,8ad742afefa6168df9ae9fa01836e64ba7045559..8e70560776d15be43c4f3eee1bc529a9703ff543
@@@ -266,23 -346,7 +266,23 @@@ NULL pointer for use in a ``return`` st
     use.
  
  
- .. c:function:: int PyErr_WarnEx(PyObject *category, char *message, int stack_level)
 +Issuing warnings
 +================
 +
 +Use these functions to issue warnings from C code.  They mirror similar
 +functions exported by the Python :mod:`warnings` module.  They normally
 +print a warning message to *sys.stderr*; however, it is
 +also possible that the user has specified that warnings are to be turned into
 +errors, and in that case they will raise an exception.  It is also possible that
 +the functions raise an exception because of a problem with the warning machinery.
 +The return value is ``0`` if no exception is raised, or ``-1`` if an exception
 +is raised.  (It is not possible to determine whether a warning message is
 +actually printed, nor what the reason is for the exception; this is
 +intentional.)  If an exception is raised, the caller should do its normal
 +exception handling (for example, :c:func:`Py_DECREF` owned references and return
 +an error value).
 +
+ .. c:function:: int PyErr_WarnEx(PyObject *category, const char *message, Py_ssize_t stack_level)
  
     Issue a warning message.  The *category* argument is a warning category (see
     below) or *NULL*; the *message* argument is an UTF-8 encoded string.  *stack_level* is a