PyErr_Warn or PyErr_WarnEx

Now that we're aggressively adding Py3k warnings to the trunk, I think it's a good time to get this straightened out. The docs [1] say PyErr_Warn is deprecated in favor of PyErr_WarnEx. However, I have seen both in recent checkins. What is preferred? [1] http://docs.python.org/dev/c-api/exceptions.html Cheers, Benjamin Peterson

On Tue, Mar 18, 2008 at 10:07 PM, Benjamin Peterson <musiccomposition@gmail.com> wrote:
Now that we're aggressively adding Py3k warnings to the trunk, I think it's a good time to get this straightened out. The docs [1] say PyErr_Warn is deprecated in favor of PyErr_WarnEx. However, I have seen both in recent checkins. What is preferred?
PyErr_WarnEx should be used. PyErr_Warn is just (see from Include/pyerrors.h): #define PyErr_Warn(category, msg) PyErr_WarnEx(category, msg, 1) If someone wants to remove the macro in 3k, go for it. There are many of these compatibility macros and stub functions left around for binary compatibility. We should try to get rid of those in 3k and shrink the API. n
participants (2)
-
Benjamin Peterson
-
Neal Norwitz