mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
substitute PyDict_Check() for PyObject_IsInstance
This commit is contained in:
parent
d4e31a4316
commit
5fb877027b
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue