\f
+/* Exception doc strings */
+
static char
AssertionError__doc__[] = "Assertion failed.";
static char
TabError__doc__[] = "Improper mixture of spaces and tabs.";
+/* Warning category docstrings */
+
+static char
+Warning__doc__[] = "Base class for warning categories.";
+
+static char
+UserWarning__doc__[] = "Base class for warnings generated by user code.";
+
+static char
+DeprecationWarning__doc__[] =
+"Base class for warnings about deprecated features.";
+
+static char
+SyntaxWarning__doc__[] = "Base class for warnings about dubious syntax.";
+
+static char
+RuntimeWarning__doc__[] =
+"Base class for warnings about dubious runtime behavior.";
+
\f
/* module global functions */
*/
PyObject *PyExc_MemoryErrorInst;
+/* Predefined warning categories */
+PyObject *PyExc_Warning;
+PyObject *PyExc_UserWarning;
+PyObject *PyExc_DeprecationWarning;
+PyObject *PyExc_SyntaxWarning;
+PyObject *PyExc_RuntimeWarning;
+
\f
/* mapping between exception names and their PyObject ** */
{"UnicodeError", &PyExc_UnicodeError, &PyExc_ValueError, UnicodeError__doc__},
{"SystemError", &PyExc_SystemError, 0, SystemError__doc__},
{"MemoryError", &PyExc_MemoryError, 0, MemoryError__doc__},
+ /* Warning categories */
+ {"Warning", &PyExc_Warning, &PyExc_Exception, Warning__doc__},
+ {"UserWarning", &PyExc_UserWarning, &PyExc_Warning, UserWarning__doc__},
+ {"DeprecationWarning", &PyExc_DeprecationWarning, &PyExc_Warning,
+ DeprecationWarning__doc__},
+ {"SyntaxWarning", &PyExc_SyntaxWarning, &PyExc_Warning, SyntaxWarning__doc__},
+ {"RuntimeWarning", &PyExc_RuntimeWarning, &PyExc_Warning,
+ RuntimeWarning__doc__},
/* Sentinel */
{NULL}
};