From 3fc30372c71b5e6885fd617ad68fc119a09dd5a4 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 15 Dec 2000 21:57:34 +0000 Subject: [PATCH] Add declarations for standard warning category classes (PyExc_Warning etc.) and the PyErr_Warn() function. --- Include/pyerrors.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 8747aec9c57..c8c3d823118 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -60,6 +60,13 @@ extern DL_IMPORT(PyObject *) PyExc_WindowsError; extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst; +/* Predefined warning categories */ +extern DL_IMPORT(PyObject *) PyExc_Warning; +extern DL_IMPORT(PyObject *) PyExc_UserWarning; +extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning; +extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning; +extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning; + /* Convenience functions */ @@ -85,6 +92,9 @@ DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base, PyObject *dict); extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *); +/* Issue a warning or exception */ +extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *); + /* In sigcheck.c or signalmodule.c */ extern DL_IMPORT(int) PyErr_CheckSignals(void); extern DL_IMPORT(void) PyErr_SetInterrupt(void);