mirror of
https://github.com/python/cpython
synced 2026-09-29 09:25:29 +03:00
Fix buglet in sliceobjects, they were not returning Py_NotImplemented when
compared against something other than sliceobjects.
This commit is contained in:
parent
ed03b4121e
commit
3e57b52bb8
2 changed files with 8 additions and 0 deletions
|
|
@ -286,6 +286,11 @@ slice_richcompare(PyObject *v, PyObject *w, int op)
|
|||
PyObject *t2;
|
||||
PyObject *res;
|
||||
|
||||
if (!PySlice_Check(v) || !PySlice_Check(w)) {
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
}
|
||||
|
||||
if (v == w) {
|
||||
/* XXX Do we really need this shortcut?
|
||||
There's a unit test for it, but is that fair? */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue