mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-19225: Remove duplicated description for standard warning categories (GH-1068)
This commit is contained in:
parent
39f5956ffb
commit
eaeda64c2f
1 changed files with 9 additions and 12 deletions
|
@ -291,16 +291,11 @@ an error value).
|
||||||
is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that,
|
is the function calling :c:func:`PyErr_WarnEx`, 2 is the function above that,
|
||||||
and so forth.
|
and so forth.
|
||||||
|
|
||||||
Warning categories must be subclasses of :c:data:`Warning`; the default warning
|
Warning categories must be subclasses of :c:data:`PyExc_Warning`;
|
||||||
category is :c:data:`RuntimeWarning`. The standard Python warning categories are
|
:c:data:`PyExc_Warning` is a subclass of :c:data:`PyExc_Exception`;
|
||||||
available as global variables whose names are ``PyExc_`` followed by the Python
|
the default warning category is :c:data:`PyExc_RuntimeWarning`. The standard
|
||||||
exception name. These have the type :c:type:`PyObject\*`; they are all class
|
Python warning categories are available as global variables whose names are
|
||||||
objects. Their names are :c:data:`PyExc_Warning`, :c:data:`PyExc_UserWarning`,
|
enumerated at :ref:`standarwarningcategories`.
|
||||||
: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`.
|
|
||||||
|
|
||||||
For information about warning control, see the documentation for the
|
For information about warning control, see the documentation for the
|
||||||
:mod:`warnings` module and the :option:`-W` option in the command line
|
:mod:`warnings` module and the :option:`-W` option in the command line
|
||||||
|
@ -963,8 +958,10 @@ Notes:
|
||||||
Only defined on Windows; protect code that uses this by testing that the
|
Only defined on Windows; protect code that uses this by testing that the
|
||||||
preprocessor macro ``MS_WINDOWS`` is defined.
|
preprocessor macro ``MS_WINDOWS`` is defined.
|
||||||
|
|
||||||
Standard Warnings
|
.. _standarwarningcategories:
|
||||||
=================
|
|
||||||
|
Standard Warning Categories
|
||||||
|
===========================
|
||||||
|
|
||||||
All standard Python warning categories are available as global variables whose
|
All standard Python warning categories are available as global variables whose
|
||||||
names are ``PyExc_`` followed by the Python exception name. These have the type
|
names are ``PyExc_`` followed by the Python exception name. These have the type
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue