Skip to content

Commit 450a69c

Browse files
cocoatomoberkerpeksag
authored andcommitted
bpo-19225: Remove duplicated description for standard warning categories (GH-1068)
1 parent 2a1bf06 commit 450a69c

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

Doc/c-api/exceptions.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,16 +286,11 @@ is a separate error indicator for each thread.
286286
exception handling (for example, :c:func:`Py_DECREF` owned references and return
287287
an error value).
288288
289-
Warning categories must be subclasses of :c:data:`Warning`; the default warning
290-
category is :c:data:`RuntimeWarning`. The standard Python warning categories are
291-
available as global variables whose names are ``PyExc_`` followed by the Python
292-
exception name. These have the type :c:type:`PyObject\*`; they are all class
293-
objects. Their names are :c:data:`PyExc_Warning`, :c:data:`PyExc_UserWarning`,
294-
:c:data:`PyExc_UnicodeWarning`, :c:data:`PyExc_DeprecationWarning`,
295-
:c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and
296-
:c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of
297-
:c:data:`PyExc_Exception`; the other warning categories are subclasses of
298-
:c:data:`PyExc_Warning`.
289+
Warning categories must be subclasses of :c:data:`PyExc_Warning`;
290+
:c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`;
291+
the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard
292+
Python warning categories are available as global variables whose names are
293+
enumerated at :ref:`standarwarningcategories`.
299294
300295
For information about warning control, see the documentation for the
301296
:mod:`warnings` module and the :option:`-W` option in the command line
@@ -670,8 +665,10 @@ Notes:
670665
Only defined on VMS; protect code that uses this by testing that the
671666
preprocessor macro ``__VMS`` is defined.
672667
673-
Standard Warnings
674-
=================
668+
.. _standarwarningcategories:
669+
670+
Standard Warning Categories
671+
===========================
675672
676673
All standard Python warning categories are available as global variables whose
677674
names are ``PyExc_`` followed by the Python exception name. These have the type

0 commit comments

Comments
 (0)