only need to catch an TypeError here

This commit is contained in:
Benjamin Peterson 2009-05-09 19:30:46 +00:00
parent e18df23d5d
commit b0ba27dff1
1 changed files with 2 additions and 3 deletions

View File

@ -83,9 +83,8 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
if (rv >= 0)
return rv;
if (PyErr_Occurred()) {
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
!PyErr_ExceptionMatches(PyExc_AttributeError))
return -1;
if (!PyErr_ExceptionMatches(PyExc_TypeError))
return -1;
PyErr_Clear();
}