diff options
-rw-r--r-- | Modules/collectionsmodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Modules/collectionsmodule.c b/Modules/collectionsmodule.c index e49224d..368f0b6 100644 --- a/Modules/collectionsmodule.c +++ b/Modules/collectionsmodule.c @@ -587,7 +587,8 @@ deque_richcompare(PyObject *v, PyObject *w, int op) PyObject *it1=NULL, *it2=NULL, *x, *y; int i, b, vs, ws, minlen, cmp=-1; - if (v->ob_type != &deque_type || w->ob_type != &deque_type) { + if (!PyObject_TypeCheck(v, &deque_type) || + !PyObject_TypeCheck(w, &deque_type)) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } |