aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 973c43fe7fd..aac42c2898c 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -2083,7 +2083,9 @@ _PySequence_IterSearch(PyObject *seq, PyObject *obj, int operation)
it = PyObject_GetIter(seq);
if (it == NULL) {
- type_error("argument of type '%.200s' is not iterable", seq);
+ if (PyErr_ExceptionMatches(PyExc_TypeError)) {
+ type_error("argument of type '%.200s' is not iterable", seq);
+ }
return -1;
}