mirror of
https://github.com/python/cpython.git
synced 2025-08-27 20:25:18 +00:00
PyErr_Warn is deprecated in 2.5 - goes away for 3.0
This commit is contained in:
parent
447e7c3981
commit
46fc337395
11 changed files with 40 additions and 55 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue