diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-03-13 09:48:39 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-03-13 09:48:39 (GMT) |
commit | f673f0c40c663c96539950ecd11333715e621c57 (patch) | |
tree | 1564f29bff4d8850062ec6de00f37b6ec1124123 /Objects | |
parent | ad0ef571b70bac3764792aaeb1d966b553ecd256 (diff) | |
download | cpython-f673f0c40c663c96539950ecd11333715e621c57.zip cpython-f673f0c40c663c96539950ecd11333715e621c57.tar.gz cpython-f673f0c40c663c96539950ecd11333715e621c57.tar.bz2 |
Issue #7845: Make 1j.__le__(2j) return NotImplemented rather than raising TypeError.
Diffstat (limited to 'Objects')
-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 4821d1e..0e55bc3 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)) |