Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eaeda64

Browse files
cocoatomoberkerpeksag
authored andcommitted
bpo-19225: Remove duplicated description for standard warning categories (GH-1068)
1 parent 39f5956 commit eaeda64

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

Doc/c-api/exceptions.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,16 +291,11 @@ an error value).
291291
is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that,
292292
and so forth.
293293
294-
Warning categories must be subclasses of :c:data:`Warning`; the default warning
295-
category is :c:data:`RuntimeWarning`. The standard Python warning categories are
296-
available as global variables whose names are ``PyExc_`` followed by the Python
297-
exception name. These have the type :c:type:`PyObject\*`; they are all class
298-
objects. Their names are :c:data:`PyExc_Warning`, :c:data:`PyExc_UserWarning`,
299-
:c:data:`PyExc_UnicodeWarning`, :c:data:`PyExc_DeprecationWarning`,
300-
:c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and
301-
:c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of
302-
:c:data:`PyExc_Exception`; the other warning categories are subclasses of
303-
:c:data:`PyExc_Warning`.
294+
Warning categories must be subclasses of :c:data:`PyExc_Warning`;
295+
:c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`;
296+
the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard
297+
Python warning categories are available as global variables whose names are
298+
enumerated at :ref:`standarwarningcategories`.
304299
305300
For information about warning control, see the documentation for the
306301
:mod:`warnings` module and the :option:`-W` option in the command line
@@ -963,8 +958,10 @@ Notes:
963958
Only defined on Windows; protect code that uses this by testing that the
964959
preprocessor macro ``MS_WINDOWS`` is defined.
965960
966-
Standard Warnings
967-
=================
961+
.. _standarwarningcategories:
962+
963+
Standard Warning Categories
964+
===========================
968965
969966
All standard Python warning categories are available as global variables whose
970967
names are ``PyExc_`` followed by the Python exception name. These have the type

0 commit comments

Comments
 (0)