PyErr_Warn is deprecated in 2.5 - goes away for 3.0

This commit is contained in:
Skip Montanaro 2007-08-12 11:44:53 +00:00
parent 447e7c3981
commit 46fc337395
11 changed files with 40 additions and 55 deletions

View file

@ -5990,15 +5990,16 @@ PyObject *PyUnicode_RichCompare(PyObject *left,
if (!PyErr_ExceptionMatches(PyExc_UnicodeDecodeError))
return NULL;
PyErr_Clear();
if (PyErr_Warn(PyExc_UnicodeWarning,
(op == Py_EQ) ?
"Unicode equal comparison "
"failed to convert both arguments to Unicode - "
"interpreting them as being unequal" :
"Unicode unequal comparison "
"failed to convert both arguments to Unicode - "
"interpreting them as being unequal"
) < 0)
if (PyErr_WarnEx(PyExc_UnicodeWarning,
(op == Py_EQ) ?
"Unicode equal comparison "
"failed to convert both arguments to Unicode - "
"interpreting them as being unequal"
:
"Unicode unequal comparison "
"failed to convert both arguments to Unicode - "
"interpreting them as being unequal",
1) < 0)
return NULL;
result = (op == Py_NE);
return PyBool_FromLong(result);