diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-08-04 11:12:48 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-04 11:12:48 (GMT) |
commit | 18b711c5a7f90d88fb74748f18fa8ef49d8486c7 (patch) | |
tree | d04ab59ccadbade80f8999c921dd3a19b62a9cc9 /Modules/_asynciomodule.c | |
parent | 17e52649c0e7e9389f1cc2444a53f059e24e6bca (diff) | |
download | cpython-18b711c5a7f90d88fb74748f18fa8ef49d8486c7.zip cpython-18b711c5a7f90d88fb74748f18fa8ef49d8486c7.tar.gz cpython-18b711c5a7f90d88fb74748f18fa8ef49d8486c7.tar.bz2 |
bpo-37648: Fixed minor inconsistency in some __contains__. (GH-14904)
The collection's item is now always at the left and
the needle is on the right of ==.
Diffstat (limited to 'Modules/_asynciomodule.c')
-rw-r--r-- | Modules/_asynciomodule.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index e9e6c56..4d503a4 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -937,7 +937,7 @@ _asyncio_Future_remove_done_callback(FutureObj *self, PyObject *fn) ENSURE_FUTURE_ALIVE(self) if (self->fut_callback0 != NULL) { - int cmp = PyObject_RichCompareBool(fn, self->fut_callback0, Py_EQ); + int cmp = PyObject_RichCompareBool(self->fut_callback0, fn, Py_EQ); if (cmp == -1) { return NULL; } @@ -962,7 +962,7 @@ _asyncio_Future_remove_done_callback(FutureObj *self, PyObject *fn) if (len == 1) { PyObject *cb_tup = PyList_GET_ITEM(self->fut_callbacks, 0); int cmp = PyObject_RichCompareBool( - fn, PyTuple_GET_ITEM(cb_tup, 0), Py_EQ); + PyTuple_GET_ITEM(cb_tup, 0), fn, Py_EQ); if (cmp == -1) { return NULL; } @@ -984,7 +984,7 @@ _asyncio_Future_remove_done_callback(FutureObj *self, PyObject *fn) int ret; PyObject *item = PyList_GET_ITEM(self->fut_callbacks, i); Py_INCREF(item); - ret = PyObject_RichCompareBool(fn, PyTuple_GET_ITEM(item, 0), Py_EQ); + ret = PyObject_RichCompareBool(PyTuple_GET_ITEM(item, 0), fn, Py_EQ); if (ret == 0) { if (j < len) { PyList_SET_ITEM(newlist, j, item); |