Commit 12241ffc authored by Stefan Behnel's avatar Stefan Behnel

use faster method lookup in generator code

parent 7f73d961
......@@ -80,6 +80,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
//@requires: Exceptions.c::SwapException
//@requires: Exceptions.c::RaiseException
//@requires: ObjectHandling.c::PyObjectCallMethod1
//@requires: ObjectHandling.c::PyObjectGetAttrStr
//@requires: CommonTypes.c::FetchCommonType
static PyObject *__Pyx_Generator_Next(PyObject *self);
......@@ -148,7 +149,7 @@ static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
Py_DECREF(ev);
#else
{
PyObject* args = PyObject_GetAttr(ev, PYIDENT("args"));
PyObject* args = __Pyx_PyObject_GetAttrStr(ev, PYIDENT("args"));
Py_DECREF(ev);
if (likely(args)) {
value = PyObject_GetItem(args, 0);
......@@ -335,7 +336,7 @@ static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
} else {
PyObject *meth;
gen->is_running = 1;
meth = PyObject_GetAttr(yf, PYIDENT("close"));
meth = __Pyx_PyObject_GetAttrStr(yf, PYIDENT("close"));
if (unlikely(!meth)) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
PyErr_WriteUnraisable(yf);
......@@ -420,7 +421,7 @@ static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
if (__Pyx_Generator_CheckExact(yf)) {
ret = __Pyx_Generator_Throw(yf, args);
} else {
PyObject *meth = PyObject_GetAttr(yf, PYIDENT("throw"));
PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, PYIDENT("throw"));
if (unlikely(!meth)) {
Py_DECREF(yf);
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment