summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/abstract.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 99b22db..e90710c 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -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;
}