diff options
author | Georg Brandl <georg@python.org> | 2008-10-08 18:47:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-10-08 18:47:17 (GMT) |
commit | f3776a17effc7542826e1453b082ca0877722464 (patch) | |
tree | 707a0fa81eda3e0cf4277c66a9a5b1b2ceea29f6 /Modules/_bisectmodule.c | |
parent | 06a138690231f62b3624766e09212cc01d7b5faa (diff) | |
download | cpython-f3776a17effc7542826e1453b082ca0877722464.zip cpython-f3776a17effc7542826e1453b082ca0877722464.tar.gz cpython-f3776a17effc7542826e1453b082ca0877722464.tar.bz2 |
#3935: properly support list subclasses in the C impl. of bisect.
Patch reviewed by Raymond.
Diffstat (limited to 'Modules/_bisectmodule.c')
-rw-r--r-- | Modules/_bisectmodule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c index 4469dc0..fc54954 100644 --- a/Modules/_bisectmodule.c +++ b/Modules/_bisectmodule.c @@ -82,7 +82,7 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw) index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; - if (PyList_Check(list)) { + if (PyList_CheckExact(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { @@ -183,7 +183,7 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw) index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; - if (PyList_Check(list)) { + if (PyList_CheckExact(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { |