Skip to content

Commit b3be16d

Browse files
authored
gh-151941: Fix Sphinx reference warnings in Doc/c-api/ (GH-152044)
1 parent 22a6c51 commit b3be16d

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
@@ -1235,9 +1235,9 @@ PyConfig
12351235
12361236
.. c:member:: wchar_t* base_executable
12371237
1238-
Python base executable: :data:`sys._base_executable`.
1238+
Python base executable: ``sys._base_executable``.
12391239
1240-
Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable.
1240+
Set by the ``__PYVENV_LAUNCHER__`` environment variable.
12411241
12421242
Set from :c:member:`PyConfig.executable` if ``NULL``.
12431243
@@ -1748,7 +1748,7 @@ PyConfig
17481748
17491749
* On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set.
17501750
* If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use
1751-
:envvar:`__PYVENV_LAUNCHER__` environment variable if set.
1751+
``__PYVENV_LAUNCHER__`` environment variable if set.
17521752
* Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and
17531753
non-empty.
17541754
* Otherwise, use ``L"python"`` on Windows, or ``L"python3"`` on other
@@ -1984,8 +1984,7 @@ PyConfig
19841984
19851985
The :mod:`warnings` module adds :data:`sys.warnoptions` in the reverse
19861986
order: the last :c:member:`PyConfig.warnoptions` item becomes the first
1987-
item of :data:`warnings.filters` which is checked first (highest
1988-
priority).
1987+
item of ``warnings.filters`` which is checked first (highest priority).
19891988
19901989
The :option:`-W` command line options adds its value to
19911990
: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
@@ -1163,7 +1163,7 @@ when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
11631163
In addition to the reference count debugging described below, extra checks are
11641164
performed. See :ref:`Python Debug Build <debug-build>` for more details.
11651165

1166-
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
1166+
Defining ``Py_TRACE_REFS`` enables reference tracing
11671167
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).
11681168
When defined, a circular doubly linked list of active objects is maintained by adding two extra
11691169
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
@@ -2,9 +2,6 @@
22
# as tested on the CI via check-warnings.py in reusable-docs.yml.
33
# Keep lines sorted lexicographically to help avoid merge conflicts.
44

5-
Doc/c-api/init_config.rst
6-
Doc/c-api/intro.rst
7-
Doc/c-api/stable.rst
85
Doc/library/ast.rst
96
Doc/library/asyncio-extending.rst
107
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
@@ -37,8 +37,6 @@ PyWrapperFlag_KEYWORDS
3737
Py_UniversalNewlineFgets
3838
# cpython/pylifecycle.h
3939
Py_FrozenMain
40-
# pythonrun.h
41-
PyErr_Display
4240
# cpython/objimpl.h
4341
PyObject_GET_WEAKREFS_LISTPTR
4442
# cpython/pythonrun.h

0 commit comments

Comments
 (0)