summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index cade2aa..94af3da 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -1401,6 +1401,11 @@ PySequence_Tuple(PyObject *v)
/* Guess result size and allocate space. */
n = PyObject_Size(v);
if (n < 0) {
+ if (!PyErr_ExceptionMatches(PyExc_TypeError) &&
+ !PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ Py_DECREF(it);
+ return NULL;
+ }
PyErr_Clear();
n = 10; /* arbitrary */
}