Skip to content

[3.5] bpo-19225: Remove duplicated description for standard warning categories #1200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 9 additions & 12 deletions Doc/c-api/exceptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -291,16 +291,11 @@ an error value).
is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that,
and so forth.

Warning categories must be subclasses of :c:data:`Warning`; the default warning
category is :c:data:`RuntimeWarning`. The standard Python warning categories are
available as global variables whose names are ``PyExc_`` followed by the Python
exception name. These have the type :c:type:`PyObject\*`; they are all class
objects. Their names are :c:data:`PyExc_Warning`, :c:data:`PyExc_UserWarning`,
:c:data:`PyExc_UnicodeWarning`, :c:data:`PyExc_DeprecationWarning`,
:c:data:`PyExc_SyntaxWarning`, :c:data:`PyExc_RuntimeWarning`, and
:c:data:`PyExc_FutureWarning`. :c:data:`PyExc_Warning` is a subclass of
:c:data:`PyExc_Exception`; the other warning categories are subclasses of
:c:data:`PyExc_Warning`.
Warning categories must be subclasses of :c:data:`PyExc_Warning`;
:c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`;
the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard
Python warning categories are available as global variables whose names are
enumerated at :ref:`standarwarningcategories`.

For information about warning control, see the documentation for the
:mod:`warnings` module and the :option:`-W` option in the command line
Expand Down Expand Up @@ -942,8 +937,10 @@ Notes:
Only defined on Windows; protect code that uses this by testing that the
preprocessor macro ``MS_WINDOWS`` is defined.

Standard Warnings
=================
.. _standarwarningcategories:

Standard Warning Categories
===========================

All standard Python warning categories are available as global variables whose
names are ``PyExc_`` followed by the Python exception name. These have the type
Expand Down