mirror of https://github.com/python/cpython
ignore AttributeErrors for classic classes
This commit is contained in:
parent
784d455066
commit
a7dc949e17
|
@ -116,7 +116,8 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
|
||||||
ro = PyObject_CallFunctionObjArgs(hintmeth, NULL);
|
ro = PyObject_CallFunctionObjArgs(hintmeth, NULL);
|
||||||
Py_DECREF(hintmeth);
|
Py_DECREF(hintmeth);
|
||||||
if (ro == NULL) {
|
if (ro == NULL) {
|
||||||
if (!PyErr_ExceptionMatches(PyExc_TypeError))
|
if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
|
||||||
|
!PyErr_ExceptionMatches(PyExc_AttributeError))
|
||||||
return -1;
|
return -1;
|
||||||
return defaultvalue;
|
return defaultvalue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue