ignore classic classes

This commit is contained in:
Benjamin Peterson 2009-05-09 16:51:51 +00:00
parent af1692a266
commit 3f3d36bd03
1 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,8 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
PyErr_Clear();
}
if (PyInstance_Check(o))
return defaultvalue;
/* try o.__length_hint__() */
hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj);
if (hintmeth == NULL)