From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 13 Nov 2025 18:05:09 +0000 (+0100) Subject: [3.14] gh-141004: Document `PyErr_RangedSyntaxLocationObject` (GH-141521) (#141525) X-Git-Tag: v3.14.1~123 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5e0ce73f93b615701df06a88d0a95d5160c7b02;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-141004: Document `PyErr_RangedSyntaxLocationObject` (GH-141521) (#141525) gh-141004: Document `PyErr_RangedSyntaxLocationObject` (GH-141521) PyErr_RangedSyntaxLocationObject (cherry picked from commit 196f1519cd2d8134d7643536f13f2b2844bea65d) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> --- diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 5241533e1128..7449935e69f7 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -309,6 +309,14 @@ For convenience, some of these functions will always return a .. versionadded:: 3.4 +.. c:function:: void PyErr_RangedSyntaxLocationObject(PyObject *filename, int lineno, int col_offset, int end_lineno, int end_col_offset) + + Similar to :c:func:`PyErr_SyntaxLocationObject`, but also sets the + *end_lineno* and *end_col_offset* information for the current exception. + + .. versionadded:: 3.10 + + .. c:function:: void PyErr_SyntaxLocationEx(const char *filename, int lineno, int col_offset) Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string