Skip to content

Commit

Permalink
Modules: Eliminate getter & setter that reimplement the default
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldap contributors authored and Petr Viktorin committed Nov 24, 2017
1 parent b0c9081 commit 2a30680
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions Modules/LDAPObject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,23 +1384,6 @@ static PyMethodDef methods[] = {
{ NULL, NULL }
};

/* get attribute */

static PyObject*
getattr(LDAPObject* self, char* name)
{
return Py_FindMethod(methods, (PyObject*)self, name);
}

/* set attribute */

static int
setattr(LDAPObject* self, char* name, PyObject* value)
{
PyErr_SetString(PyExc_AttributeError, name);
return -1;
}

/* type entry */

PyTypeObject LDAP_Type = {
Expand All @@ -1416,8 +1399,8 @@ PyTypeObject LDAP_Type = {
/* methods */
(destructor)dealloc, /*tp_dealloc*/
0, /*tp_print*/
(getattrfunc)getattr, /*tp_getattr*/
(setattrfunc)setattr, /*tp_setattr*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
0, /*tp_as_number*/
Expand Down

0 comments on commit 2a30680

Please sign in to comment.