diff options
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r-- | Objects/genobject.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c index 24a1da6..8c2213e 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -574,8 +574,7 @@ _PyGen_SetStopIterationValue(PyObject *value) PyObject *e; if (value == NULL || - (!PyTuple_Check(value) && - !PyObject_TypeCheck(value, (PyTypeObject *) PyExc_StopIteration))) + (!PyTuple_Check(value) && !PyExceptionInstance_Check(value))) { /* Delay exception instantiation if we can */ PyErr_SetObject(PyExc_StopIteration, value); |