From: cocoatomo Date: Thu, 20 Apr 2017 03:57:21 +0000 (+0900) Subject: bpo-19225: Remove duplicated description for standard warning categories (GH-1068) X-Git-Tag: v2.7.14rc1~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=450a69c6a4bfee6a10cbcc0c43b221bb135689c8;p=thirdparty%2FPython%2Fcpython.git bpo-19225: Remove duplicated description for standard warning categories (GH-1068) --- diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 545de6269470..d9e333311b59 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -286,16 +286,11 @@ is a separate error indicator for each thread. exception handling (for example, :c:func:`Py_DECREF` owned references and return an error value). - 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 @@ -670,8 +665,10 @@ Notes: Only defined on VMS; protect code that uses this by testing that the preprocessor macro ``__VMS`` 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