diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/exceptions.c | 6 | ||||
-rw-r--r-- | Objects/genobject.c | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c index 9e10b7e..f706698 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -516,12 +516,6 @@ StopIteration_traverse(PyStopIterationObject *self, visitproc visit, void *arg) return BaseException_traverse((PyBaseExceptionObject *)self, visit, arg); } -PyObject * -PyStopIteration_Create(PyObject *value) -{ - return PyObject_CallFunctionObjArgs(PyExc_StopIteration, value, NULL); -} - ComplexExtendsException( PyExc_Exception, /* base */ StopIteration, /* name */ diff --git a/Objects/genobject.c b/Objects/genobject.c index 8c70b5c..6018e5b 100644 --- a/Objects/genobject.c +++ b/Objects/genobject.c @@ -97,7 +97,8 @@ gen_send_ex(PyGenObject *gen, PyObject *arg, int exc) /* Delay exception instantiation if we can */ PyErr_SetNone(PyExc_StopIteration); } else { - PyObject *e = PyStopIteration_Create(result); + PyObject *e = PyObject_CallFunctionObjArgs( + PyExc_StopIteration, result, NULL); if (e != NULL) { PyErr_SetObject(PyExc_StopIteration, e); Py_DECREF(e); @@ -339,7 +340,7 @@ gen_throw(PyGenObject *gen, PyObject *args) Py_DECREF(ret); /* Termination repetition of YIELD_FROM */ gen->gi_frame->f_lasti++; - if (PyGen_FetchStopIterationValue(&val) == 0) { + if (_PyGen_FetchStopIterationValue(&val) == 0) { ret = gen_send_ex(gen, val, 0); Py_DECREF(val); } else { @@ -428,7 +429,7 @@ gen_iternext(PyGenObject *gen) */ int -PyGen_FetchStopIterationValue(PyObject **pvalue) { +_PyGen_FetchStopIterationValue(PyObject **pvalue) { PyObject *et, *ev, *tb; PyObject *value = NULL; |