Skip to content

Commit 754eb27

Browse files
committed
Doucment PyErr_ProgramTextObject() and PyErr_ProgramText()
1 parent 920286d commit 754eb27

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Doc/c-api/exceptions.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,22 @@ For convenience, some of these functions will always return a
331331
use.
332332
333333
334+
.. c:function:: PyObject *PyErr_ProgramTextObject(PyObject *filename, int lineno)
335+
336+
Get the source line in *filename* at line *lineno*. *filename* should be a
337+
Python :class:`str` object.
338+
339+
On success, this function returns a Python string object with the found line.
340+
On failure, this function returns ``NULL`` without an exception set.
341+
342+
343+
.. c:function:: PyObject *PyErr_ProgramText(const char *filename, int lineno)
344+
345+
Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a
346+
:c:expr:`const char *` UTF-8 encoded string instead of a Python object
347+
reference.
348+
349+
334350
Issuing warnings
335351
================
336352

0 commit comments

Comments
 (0)