From 2a30680d10ffc9db9adf634e7d075965a7ec1fcd Mon Sep 17 00:00:00 2001 From: pyldap contributors Date: Thu, 23 Nov 2017 23:14:04 +0100 Subject: [PATCH] Modules: Eliminate getter & setter that reimplement the default --- Modules/LDAPObject.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/Modules/LDAPObject.c b/Modules/LDAPObject.c index 43bde96..2eff88e 100644 --- a/Modules/LDAPObject.c +++ b/Modules/LDAPObject.c @@ -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 = { @@ -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*/