From: Benjamin Peterson Date: Sat, 9 May 2009 19:30:46 +0000 (+0000) Subject: only need to catch an TypeError here X-Git-Tag: v3.1rc1~194 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0ba27dff1442fe6dc7b00ce7d8488afb159d9b8;p=python only need to catch an TypeError here --- diff --git a/Objects/abstract.c b/Objects/abstract.c index 52c90259e8..cc125f5fa4 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -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(); }