diff options
author | Brett Cannon <bcannon@gmail.com> | 2008-04-12 23:44:07 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2008-04-12 23:44:07 (GMT) |
commit | e9746890388178bb1e4cdad3c0586bf1862c3727 (patch) | |
tree | 77e228e19ac5673aac13dac8292281fc9a3010ab /Include/warnings.h | |
parent | e6c03033afc58804cfdb143bef67e9cd37e25507 (diff) | |
download | cpython-e9746890388178bb1e4cdad3c0586bf1862c3727.zip cpython-e9746890388178bb1e4cdad3c0586bf1862c3727.tar.gz cpython-e9746890388178bb1e4cdad3c0586bf1862c3727.tar.bz2 |
Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.
Closes issue #1631171.
Diffstat (limited to 'Include/warnings.h')
-rw-r--r-- | Include/warnings.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Include/warnings.h b/Include/warnings.h new file mode 100644 index 0000000..e93b72c --- /dev/null +++ b/Include/warnings.h @@ -0,0 +1,19 @@ +#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 */
\ No newline at end of file |