#3935: properly support list subclasses in the C impl. of bisect.
Patch reviewed by Raymond.
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 @@
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 @@
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 {