[Python-Dev] Interface to change Py3kWarning in Python (original) (raw)

Benjamin Peterson musiccomposition at gmail.com
Sat Apr 19 17:37:36 CEST 2008


On Sat, Apr 19, 2008 at 9:12 AM, Georg Brandl <g.brandl at gmx.net> wrote:

Christian Heimes schrieb: > > How do you like a macro or function PyErrWarn3k(msg) that does all the > dirty work?

Which additional dirty work would it do? It should never have to do more than check a simple static C variable, for obvious reasons. Even if there's no dirty work, it could clean up this:

if (Py_Py3kWarningFlag && PyErr_WarnEx(PyErr_DeprecationWarning, "msg", 2) < 0)

to

if (PyErr_WarnPy3k("msg", 2) < 0)

Georg

-- Cheers, Benjamin Peterson



More information about the Python-Dev mailing list