示例#1
0
    static PyObject *
BufferGetattr(PyObject *self, char *name)
{
    PyObject *r;

    if (CheckBuffer((BufferObject *)(self)))
	return NULL;

    r = BufferAttr((BufferObject *)(self), name);
    if (r || PyErr_Occurred())
	return r;
    else
	return Py_FindMethod(BufferMethods, self, name);
}
示例#2
0
static PyObject *
BufferGetattro(PyObject *self, PyObject *nameobj)
{
	PyObject *r;

	GET_ATTR_STRING(name, nameobj);

	if ((r = BufferAttrValid((BufferObject *)(self), name)))
		return r;

	if (CheckBuffer((BufferObject *)(self)))
		return NULL;

	r = BufferAttr((BufferObject *)(self), name);
	if (r || PyErr_Occurred())
		return r;
	else
		return PyObject_GenericGetAttr(self, nameobj);
}