diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-03-13 09:48:39 +0000 |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-03-13 09:48:39 +0000 |
commit | 81ab44551ac17d31f13993f81a92c5807499b740 (patch) | |
tree | 41b760ca4b8f2d351fa735b1023a3fca518e5369 /Objects/complexobject.c | |
parent | b6ccf938ecebfa97dbe3a58aa8890004dca23865 (diff) | |
download | cpython-81ab44551ac17d31f13993f81a92c5807499b740.tar.gz |
Issue #7845: Make 1j.__le__(2j) return NotImplemented rather than raising TypeError.
Diffstat (limited to 'Objects/complexobject.c')
-rw-r--r-- | Objects/complexobject.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c index 4821d1e3a2..0e55bc323c 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -625,10 +625,8 @@ complex_richcompare(PyObject *v, PyObject *w, int op) TO_COMPLEX(w, j); if (op != Py_EQ && op != Py_NE) { - /* XXX Should eventually return NotImplemented */ - PyErr_SetString(PyExc_TypeError, - "no ordering relation is defined for complex numbers"); - return NULL; + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } if ((i.real == j.real && i.imag == j.imag) == (op == Py_EQ)) |