summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 83f5367..52c9025 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -98,6 +98,7 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue)
if (ro == NULL) {
if (!PyErr_ExceptionMatches(PyExc_TypeError))
return -1;
+ PyErr_Clear();
return defaultvalue;
}
rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue;