summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-05-26 17:43:53 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-05-26 17:43:53 (GMT)
commitdacde0d6ae72451ef102aa98ca36b733277d15bb (patch)
tree5fe8889292d15688bca575f2e208d544ec7562ff /Include
parenteeb2b21ab0ecc3f10a51eea989ba6c2f1f01a9bd (diff)
downloadcpython-dacde0d6ae72451ef102aa98ca36b733277d15bb.zip
cpython-dacde0d6ae72451ef102aa98ca36b733277d15bb.tar.gz
cpython-dacde0d6ae72451ef102aa98ca36b733277d15bb.tar.bz2
turn PyErr_WarnPy3k into a macro
Diffstat (limited to 'Include')
-rw-r--r--Include/warnings.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/warnings.h b/Include/warnings.h
index e761ade..79ef9f3 100644
--- a/Include/warnings.h
+++ b/Include/warnings.h
@@ -9,7 +9,8 @@ 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 *);
-PyAPI_FUNC(int) PyErr_WarnPy3k(const char *, Py_ssize_t);
+
+#define PyErr_WarnPy3k(msg, stacklevel) (Py_Py3kWarningFlag ? PyErr_WarnEx(PyExc_DeprecationWarning, msg, stacklevel) : 0)
/* DEPRECATED: Use PyErr_WarnEx() instead. */
#define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)