diff options
author | Marc-André Lemburg <mal@egenix.com> | 2006-08-14 10:55:19 (GMT) |
---|---|---|
committer | Marc-André Lemburg <mal@egenix.com> | 2006-08-14 10:55:19 (GMT) |
commit | 040f76b79c0ce86dc33b9c525fbcd84b2254e559 (patch) | |
tree | e907d6c112d52b1a92d7b98c63023ca338c9a188 /Objects/object.c | |
parent | e6dd31c50be76a5b57917226e16bdaa6ca20a28f (diff) | |
download | cpython-040f76b79c0ce86dc33b9c525fbcd84b2254e559.zip cpython-040f76b79c0ce86dc33b9c525fbcd84b2254e559.tar.gz cpython-040f76b79c0ce86dc33b9c525fbcd84b2254e559.tar.bz2 |
Slightly revised version of patch #1538956:
Replace UnicodeDecodeErrors raised during == and !=
compares of Unicode and other objects with a new
UnicodeWarning.
All other comparisons continue to raise exceptions.
Exceptions other than UnicodeDecodeErrors are also left
untouched.
Diffstat (limited to 'Objects/object.c')
-rw-r--r-- | Objects/object.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/Objects/object.c b/Objects/object.c index 73c8941..b0672f3 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -731,23 +731,6 @@ default_3way_compare(PyObject *v, PyObject *w) return (vv < ww) ? -1 : (vv > ww) ? 1 : 0; } -#ifdef Py_USING_UNICODE - /* Special case for Unicode */ - if (PyUnicode_Check(v) || PyUnicode_Check(w)) { - c = PyUnicode_Compare(v, w); - if (!PyErr_Occurred()) - return c; - /* TypeErrors are ignored: if Unicode coercion fails due - to one of the arguments not having the right type, we - continue as defined by the coercion protocol (see - above). Luckily, decoding errors are reported as - ValueErrors and are not masked by this technique. */ - if (!PyErr_ExceptionMatches(PyExc_TypeError)) - return -2; - PyErr_Clear(); - } -#endif - /* None is smaller than anything */ if (v == Py_None) return -1; |