Commit 335a1b21 authored by Stefan Behnel's avatar Stefan Behnel

use __Pyx_PyObject_GetAttrStr() in some more places

parent f65e44a5
......@@ -14,6 +14,7 @@
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
/////////////// Import ///////////////
//@requires: ObjectHandling.c::PyObjectGetAttrStr
//@substitute: naming
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
......@@ -23,8 +24,8 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
PyObject *empty_dict = 0;
PyObject *list;
#if PY_VERSION_HEX < 0x03030000
PyObject *py_import = 0;
py_import = __Pyx_GetAttrString($builtins_cname, "__import__");
PyObject *py_import;
py_import = __Pyx_PyObject_GetAttrStr($builtins_cname, PYIDENT("__import__"));
if (!py_import)
goto bad;
#endif
......
......@@ -659,6 +659,7 @@ static CYTHON_INLINE PyObject* __Pyx_Py{{type}}_GetSlice(
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
/////////////// FindPy2Metaclass ///////////////
//@requires: PyObjectGetAttrStr
static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
PyObject *metaclass;
......@@ -666,7 +667,7 @@ static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases) {
#if PY_MAJOR_VERSION < 3
if (PyTuple_Check(bases) && PyTuple_GET_SIZE(bases) > 0) {
PyObject *base = PyTuple_GET_ITEM(bases, 0);
metaclass = PyObject_GetAttr(base, PYIDENT("__class__"));
metaclass = __Pyx_PyObject_GetAttrStr(base, PYIDENT("__class__"));
if (!metaclass) {
PyErr_Clear();
metaclass = (PyObject*) Py_TYPE(base);
......@@ -742,6 +743,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases,
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, PyObject *mkw); /*proto*/
/////////////// Py3ClassCreate ///////////////
//@requires: PyObjectGetAttrStr
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
......@@ -749,7 +751,7 @@ static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases,
PyObject *pargs;
PyObject *ns;
prep = PyObject_GetAttr(metaclass, PYIDENT("__prepare__"));
prep = __Pyx_PyObject_GetAttrStr(metaclass, PYIDENT("__prepare__"));
if (!prep) {
if (!PyErr_ExceptionMatches(PyExc_AttributeError))
return NULL;
......
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