summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-05-18 18:15:03 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-05-18 18:15:03 (GMT)
commit285cfccecba911531b37b8a7dde45bf07d3cf9b0 (patch)
treefb03fb514b616202ad29613e406e059b16282c95 /Modules
parent9f15b5c11cb86e5680a40dce288c1e39427b4d2f (diff)
downloadcpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.zip
cpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.tar.gz
cpython-285cfccecba911531b37b8a7dde45bf07d3cf9b0.tar.bz2
Make type check work with subclasses
Diffstat (limited to 'Modules')
-rw-r--r--Modules/collectionsmodule.c3
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;
}