Mercurial > cpython-lru_cache-weakref
diff Python/_warnings.c @ 46572:d58ec38e6db1 legacy-trunk
Added PyErr_WarnPy3k function. (issue 2671) I will be converting current Py3k warnings to the use of this function soon.
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Sun, 27 Apr 2008 02:28:02 +0000 |
| parents | 6e4ca9f72bba |
| children | ea1a9cf735a5 |
line wrap: on
line diff
--- a/Python/_warnings.c Sun Apr 27 00:52:24 2008 +0000 +++ b/Python/_warnings.c Sun Apr 27 02:28:02 2008 +0000 @@ -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.");
