Commit a7dc949e authored by Benjamin Peterson's avatar Benjamin Peterson

ignore AttributeErrors for classic classes

parent 784d4550
......@@ -116,7 +116,8 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
ro = PyObject_CallFunctionObjArgs(hintmeth, NULL);
Py_DECREF(hintmeth);
if (ro == NULL) {
if (!PyErr_ExceptionMatches(PyExc_TypeError))
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
!PyErr_ExceptionMatches(PyExc_AttributeError))
return -1;
return defaultvalue;
}
......
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