Kaydet (Commit) 5fb87702 authored tarafından Benjamin Peterson's avatar Benjamin Peterson

substitute PyDict_Check() for PyObject_IsInstance

üst d4e31a43
...@@ -1810,7 +1810,7 @@ PySequence_Check(PyObject *s) ...@@ -1810,7 +1810,7 @@ PySequence_Check(PyObject *s)
{ {
if (s && PyInstance_Check(s)) if (s && PyInstance_Check(s))
return PyObject_HasAttrString(s, "__getitem__"); return PyObject_HasAttrString(s, "__getitem__");
if (PyObject_IsInstance(s, (PyObject *)&PyDict_Type)) if (PyDict_Check(s))
return 0; return 0;
return s != NULL && s->ob_type->tp_as_sequence && return s != NULL && s->ob_type->tp_as_sequence &&
s->ob_type->tp_as_sequence->sq_item != NULL; s->ob_type->tp_as_sequence->sq_item != NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment