Index: Python/_warnings.c =================================================================== --- Python/_warnings.c (revision 62464) +++ Python/_warnings.c (working copy) @@ -732,6 +732,15 @@ } +int +PyErr_WarnPy3k(const char *text, Py_ssize_t stacklevel) +{ + if (Py_Py3kWarningFlag) + return PyErr_WarnEx(PyExc_DeprecationWarning, text, stacklevel); + return 0; +} + + PyDoc_STRVAR(warn_doc, "Issue a warning, or maybe ignore it or raise an exception."); Index: Include/warnings.h =================================================================== --- Include/warnings.h (revision 62464) +++ Include/warnings.h (working copy) @@ -9,6 +9,7 @@ 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); /* DEPRECATED: Use PyErr_WarnEx() instead. */ #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1)