Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3fc3037

Browse files
committed
Add declarations for standard warning category classes (PyExc_Warning
etc.) and the PyErr_Warn() function.
1 parent 1703cf6 commit 3fc3037

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Include/pyerrors.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ extern DL_IMPORT(PyObject *) PyExc_WindowsError;
6060

6161
extern DL_IMPORT(PyObject *) PyExc_MemoryErrorInst;
6262

63+
/* Predefined warning categories */
64+
extern DL_IMPORT(PyObject *) PyExc_Warning;
65+
extern DL_IMPORT(PyObject *) PyExc_UserWarning;
66+
extern DL_IMPORT(PyObject *) PyExc_DeprecationWarning;
67+
extern DL_IMPORT(PyObject *) PyExc_SyntaxWarning;
68+
extern DL_IMPORT(PyObject *) PyExc_RuntimeWarning;
69+
6370

6471
/* Convenience functions */
6572

@@ -85,6 +92,9 @@ DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base,
8592
PyObject *dict);
8693
extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *);
8794

95+
/* Issue a warning or exception */
96+
extern DL_IMPORT(int) PyErr_Warn(PyObject *, char *);
97+
8898
/* In sigcheck.c or signalmodule.c */
8999
extern DL_IMPORT(int) PyErr_CheckSignals(void);
90100
extern DL_IMPORT(void) PyErr_SetInterrupt(void);

0 commit comments

Comments
 (0)