Skip to content

Commit 3972524

Browse files
[3.14] gh-151941: Fix Sphinx reference warnings in Doc/c-api/ (GH-152044) (GH-154921)
(cherry picked from commit b3be16d) Co-authored-by: Aniket <148300120+Aniketsy@users.noreply.github.com>
1 parent 1702ce5 commit 3972524

5 files changed

Lines changed: 20 additions & 11 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ Printing and clearing
119119
.. versionadded:: 3.12
120120
121121
122+
.. c:function:: void PyErr_Display(PyObject *unused, PyObject *value, PyObject *tb)
123+
124+
Legacy variant of :c:func:`PyErr_DisplayException`.
125+
126+
Print the exception *value* with its traceback to :data:`sys.stderr`.
127+
If *value* has no traceback set, *tb* is used as its traceback.
128+
The first argument is ignored.
129+
130+
If :data:`sys.stderr` is ``None``, nothing is printed.
131+
If :data:`sys.stderr` is not set, the exception is dumped to the
132+
C ``stderr`` stream instead.
133+
134+
.. deprecated:: 3.12
135+
Use :c:func:`PyErr_DisplayException` instead.
136+
122137
Raising exceptions
123138
==================
124139

Doc/c-api/init_config.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,9 +1237,9 @@ PyConfig
12371237
12381238
.. c:member:: wchar_t* base_executable
12391239
1240-
Python base executable: :data:`sys._base_executable`.
1240+
Python base executable: ``sys._base_executable``.
12411241
1242-
Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable.
1242+
Set by the ``__PYVENV_LAUNCHER__`` environment variable.
12431243
12441244
Set from :c:member:`PyConfig.executable` if ``NULL``.
12451245
@@ -1745,7 +1745,7 @@ PyConfig
17451745
17461746
* On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set.
17471747
* If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use
1748-
:envvar:`__PYVENV_LAUNCHER__` environment variable if set.
1748+
``__PYVENV_LAUNCHER__`` environment variable if set.
17491749
* Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and
17501750
non-empty.
17511751
* Otherwise, use ``L"python"`` on Windows, or ``L"python3"`` on other
@@ -1981,8 +1981,7 @@ PyConfig
19811981
19821982
The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
19831983
order: the last :c:member:`PyConfig.warnoptions` item becomes the first
1984-
item of :data:`warnings.filters` which is checked first (highest
1985-
priority).
1984+
item of ``warnings.filters`` which is checked first (highest priority).
19861985
19871986
The :option:`-W` command line options adds its value to
19881987
:c:member:`~PyConfig.warnoptions`, it can be used multiple times.

Doc/c-api/intro.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ in the Unix build, compiler optimization is disabled.
10731073
In addition to the reference count debugging described below, extra checks are
10741074
performed, see :ref:`Python Debug Build <debug-build>`.
10751075

1076-
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
1076+
Defining ``Py_TRACE_REFS`` enables reference tracing
10771077
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).
10781078
When defined, a circular doubly linked list of active objects is maintained by adding two extra
10791079
fields to every :c:type:`PyObject`. Total allocations are tracked as well. Upon

Doc/tools/.nitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
# Keep lines sorted lexicographically to help avoid merge conflicts.
44

55
Doc/c-api/float.rst
6-
Doc/c-api/init_config.rst
7-
Doc/c-api/intro.rst
86
Doc/c-api/module.rst
9-
Doc/c-api/stable.rst
107
Doc/library/ast.rst
118
Doc/library/asyncio-extending.rst
129
Doc/library/email.charset.rst

Tools/check-c-api-docs/ignored_c_api.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ PyWrapperFlag_KEYWORDS
6060
Py_UniversalNewlineFgets
6161
# cpython/pylifecycle.h
6262
Py_FrozenMain
63-
# pythonrun.h
64-
PyErr_Display
6563
# cpython/objimpl.h
6664
PyObject_GET_WEAKREFS_LISTPTR
6765
# cpython/pythonrun.h

0 commit comments

Comments
 (0)