mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-141004: Document PyErr_ProgramTextObject and PyErr_ProgramText (GH-141250)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
parent
6545a4e8f8
commit
be1c72a45d
1 changed files with 17 additions and 0 deletions
|
|
@ -331,6 +331,23 @@ For convenience, some of these functions will always return a
|
||||||
use.
|
use.
|
||||||
|
|
||||||
|
|
||||||
|
.. c:function:: PyObject *PyErr_ProgramTextObject(PyObject *filename, int lineno)
|
||||||
|
|
||||||
|
Get the source line in *filename* at line *lineno*. *filename* should be a
|
||||||
|
Python :class:`str` object.
|
||||||
|
|
||||||
|
On success, this function returns a Python string object with the found line.
|
||||||
|
On failure, this function returns ``NULL`` without an exception set.
|
||||||
|
|
||||||
|
|
||||||
|
.. c:function:: PyObject *PyErr_ProgramText(const char *filename, int lineno)
|
||||||
|
|
||||||
|
Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a
|
||||||
|
:c:expr:`const char *`, which is decoded with the
|
||||||
|
:term:`filesystem encoding and error handler`, instead of a
|
||||||
|
Python object reference.
|
||||||
|
|
||||||
|
|
||||||
Issuing warnings
|
Issuing warnings
|
||||||
================
|
================
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue