diff --git a/Objects/abstract.c b/Objects/abstract.c index 5eb7b28facf..8d6f023c47b 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1810,7 +1810,7 @@ PySequence_Check(PyObject *s) { if (s && PyInstance_Check(s)) return PyObject_HasAttrString(s, "__getitem__"); - if (PyObject_IsInstance(s, (PyObject *)&PyDict_Type)) + if (PyDict_Check(s)) return 0; return s != NULL && s->ob_type->tp_as_sequence && s->ob_type->tp_as_sequence->sq_item != NULL;