diff options
author | Raymond Hettinger <python@rcn.com> | 2004-05-18 18:15:03 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-05-18 18:15:03 (GMT) |
commit | 285cfccecba911531b37b8a7dde45bf07d3cf9b0 (patch) | |
tree | fb03fb514b616202ad29613e406e059b16282c95 | |
parent | 9f15b5c11cb86e5680a40dce288c1e39427b4d2f (diff) | |
download | cpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.zip cpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.tar.gz cpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.tar.bz2 |
Make type check work with subclasses
-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; } |