diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/Python.h | 1 | ||||
-rw-r--r-- | Include/pyerrors.h | 7 | ||||
-rw-r--r-- | Include/sysmodule.h | 1 | ||||
-rw-r--r-- | Include/traceback.h | 1 | ||||
-rw-r--r-- | Include/warnings.h | 20 |
5 files changed, 23 insertions, 7 deletions
diff --git a/Include/Python.h b/Include/Python.h index d16143b..b241c86 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -93,6 +93,7 @@ #include "iterobject.h" #include "genobject.h" #include "descrobject.h" +#include "warnings.h" #include "weakrefobject.h" #include "codecs.h" diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 6b520e2..6d0614c 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -218,13 +218,6 @@ PyAPI_FUNC(PyObject *) PyErr_NewException(const char *name, PyObject *base, PyObject *dict); PyAPI_FUNC(void) PyErr_WriteUnraisable(PyObject *); -/* Issue a warning or exception */ -PyAPI_FUNC(int) PyErr_WarnEx(PyObject *category, const char *msg, - Py_ssize_t stack_level); -PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, - const char *, int, - const char *, PyObject *); - /* In sigcheck.c or signalmodule.c */ PyAPI_FUNC(int) PyErr_CheckSignals(void); PyAPI_FUNC(void) PyErr_SetInterrupt(void); diff --git a/Include/sysmodule.h b/Include/sysmodule.h index 9ba39df..eeb8619 100644 --- a/Include/sysmodule.h +++ b/Include/sysmodule.h @@ -22,6 +22,7 @@ PyAPI_DATA(int) _PySys_CheckInterval; PyAPI_FUNC(void) PySys_ResetWarnOptions(void); PyAPI_FUNC(void) PySys_AddWarnOption(const wchar_t *); +PyAPI_FUNC(int) PySys_HasWarnOptions(void); #ifdef __cplusplus } diff --git a/Include/traceback.h b/Include/traceback.h index 0b3bfae..b77cc92 100644 --- a/Include/traceback.h +++ b/Include/traceback.h @@ -19,6 +19,7 @@ typedef struct _traceback { PyAPI_FUNC(int) PyTraceBack_Here(struct _frame *); PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *); +PyAPI_FUNC(int) Py_DisplaySourceLine(PyObject *, const char *, int); /* Reveal traceback type so we can typecheck traceback objects */ PyAPI_DATA(PyTypeObject) PyTraceBack_Type; diff --git a/Include/warnings.h b/Include/warnings.h new file mode 100644 index 0000000..5d13431 --- /dev/null +++ b/Include/warnings.h @@ -0,0 +1,20 @@ +#ifndef Py_WARNINGS_H +#define Py_WARNINGS_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_FUNC(void) _PyWarnings_Init(void); + +PyAPI_FUNC(int) PyErr_WarnEx(PyObject *, const char *, Py_ssize_t); +PyAPI_FUNC(int) PyErr_WarnExplicit(PyObject *, const char *, const char *, int, + const char *, PyObject *); + +/* DEPRECATED: Use PyErr_WarnEx() instead. */ +#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) + +#ifdef __cplusplus +} +#endif +#endif /* !Py_WARNINGS_H */ + |