@@ -980,15 +980,17 @@ these are the C equivalent to :func:`reprlib.recursive_repr`.
980980 invocation of :c:func: `Py_ReprEnter ` that returns zero.
981981
982982
983+ .. _standardwarningcategories :
983984.. _standardexceptions :
984985
985- Standard Exceptions
986- ===================
986+ Exception and warning types
987+ ===========================
988+
989+ All standard Python exceptions and warning categories are available as global
990+ variables whose names are ``PyExc_ `` followed by the Python exception name.
991+ These have the type :c:expr: `PyObject* `; they are all class objects.
987992
988- All standard Python exceptions are available as global variables whose names are
989- ``PyExc_ `` followed by the Python exception name. These have the type
990- :c:expr: `PyObject* `; they are all class objects. For completeness, here are all
991- the variables:
993+ For completeness, here are all the variables:
992994
993995.. list-table ::
994996 :align: left
@@ -1164,76 +1166,19 @@ the variables:
11641166 * :exc:`ZeroDivisionError`
11651167 *
11661168
1167-
1168- .. versionadded :: 3.3
1169- :c:data: `PyExc_BlockingIOError `, :c:data: `PyExc_BrokenPipeError `,
1170- :c:data: `PyExc_ChildProcessError `, :c:data: `PyExc_ConnectionError `,
1171- :c:data: `PyExc_ConnectionAbortedError `, :c:data: `PyExc_ConnectionRefusedError `,
1172- :c:data: `PyExc_ConnectionResetError `, :c:data: `PyExc_FileExistsError `,
1173- :c:data: `PyExc_FileNotFoundError `, :c:data: `PyExc_InterruptedError `,
1174- :c:data: `PyExc_IsADirectoryError `, :c:data: `PyExc_NotADirectoryError `,
1175- :c:data: `PyExc_PermissionError `, :c:data: `PyExc_ProcessLookupError `
1176- and :c:data: `PyExc_TimeoutError ` were introduced following :pep: `3151 `.
1177-
1178- .. versionadded :: 3.5
1179- :c:data: `PyExc_StopAsyncIteration ` and :c:data: `PyExc_RecursionError `.
1180-
1181- .. versionadded :: 3.6
1182- :c:data: `PyExc_ModuleNotFoundError `.
1183-
1184- .. versionadded :: 3.11
1185- :c:data: `PyExc_BaseExceptionGroup `.
1186-
1187- These are compatibility aliases to :c:data: `PyExc_OSError `:
1188-
1189-
1190- .. list-table ::
1191- :widths: auto
1192- :align: left
1193- :header-rows: 1
1194-
1195- * * C name
1196- * Notes
11971169 * * .. c:var: : PyObject *PyExc_EnvironmentError
1198- *
1170+ * :exc:`OSError`
1171+ * [3]_
11991172 * * .. c:var:: PyObject *PyExc_IOError
1200- *
1173+ * :exc:`OSError`
1174+ * [3]_
12011175 * * .. c:var:: PyObject *PyExc_WindowsError
1202- * [2]_
1203-
1204- .. versionchanged :: 3.3
1205- These aliases used to be separate exception types.
1206-
1207- Notes:
1208-
1209- .. [1 ]
1210- This is a base class for other standard exceptions.
1211-
1212- .. [2 ]
1213- Only defined on Windows; protect code that uses this by testing that the
1214- preprocessor macro ``MS_WINDOWS `` is defined.
1215-
1216- .. _standardwarningcategories :
1217-
1218- Standard Warning Categories
1219- ===========================
1220-
1221- All standard Python warning categories are available as global variables whose
1222- names are ``PyExc_ `` followed by the Python exception name. These have the type
1223- :c:expr: `PyObject* `; they are all class objects. For completeness, here are all
1224- the variables:
1225-
1226- .. list-table ::
1227- :widths: auto
1228- :align: left
1229- :header-rows: 1
1176+ * :exc:`OSError`
1177+ * [2]_ [3]_
12301178
1231- * * C name
1232- * Python name
1233- * Notes
12341179 * * .. c:var: : PyObject *PyExc_Warning
12351180 * :exc:`Warning`
1236- * [3 ]_
1181+ * [4 ]_
12371182 * * .. c:var:: PyObject *PyExc_BytesWarning
12381183 * :exc:`BytesWarning`
12391184 *
@@ -1268,13 +1213,46 @@ the variables:
12681213 * :exc:`UserWarning`
12691214 *
12701215
1216+
12711217.. versionadded :: 3.2
12721218 :c:data: `PyExc_ResourceWarning `.
12731219
1220+ .. versionadded :: 3.3
1221+ :c:data: `PyExc_BlockingIOError `, :c:data: `PyExc_BrokenPipeError `,
1222+ :c:data: `PyExc_ChildProcessError `, :c:data: `PyExc_ConnectionError `,
1223+ :c:data: `PyExc_ConnectionAbortedError `, :c:data: `PyExc_ConnectionRefusedError `,
1224+ :c:data: `PyExc_ConnectionResetError `, :c:data: `PyExc_FileExistsError `,
1225+ :c:data: `PyExc_FileNotFoundError `, :c:data: `PyExc_InterruptedError `,
1226+ :c:data: `PyExc_IsADirectoryError `, :c:data: `PyExc_NotADirectoryError `,
1227+ :c:data: `PyExc_PermissionError `, :c:data: `PyExc_ProcessLookupError `
1228+ and :c:data: `PyExc_TimeoutError ` were introduced following :pep: `3151 `.
1229+
1230+ .. versionadded :: 3.5
1231+ :c:data: `PyExc_StopAsyncIteration ` and :c:data: `PyExc_RecursionError `.
1232+
1233+ .. versionadded :: 3.6
1234+ :c:data: `PyExc_ModuleNotFoundError `.
1235+
12741236.. versionadded :: 3.10
12751237 :c:data: `PyExc_EncodingWarning `.
12761238
1239+ .. versionadded :: 3.11
1240+ :c:data: `PyExc_BaseExceptionGroup `.
1241+
12771242Notes:
12781243
1244+ .. [1 ]
1245+ This is a base class for other standard exceptions.
1246+
1247+ .. [2 ]
1248+ Only defined on Windows; protect code that uses this by testing that the
1249+ preprocessor macro ``MS_WINDOWS `` is defined.
1250+
12791251 .. [3 ]
1252+ This are compatibility alias to :c:data: `PyExc_OSError `.
1253+
1254+ .. versionchanged :: 3.3
1255+ These aliases used to be separate exception types.
1256+
1257+ .. [4 ]
12801258 This is a base class for other standard warning categories.
0 commit comments