diff --git a/Modules/LDAPObject.c b/Modules/LDAPObject.c index 1c0591c..4800724 100644 --- a/Modules/LDAPObject.c +++ b/Modules/LDAPObject.c @@ -1434,12 +1434,7 @@ static PyMethodDef methods[] = { /* type entry */ PyTypeObject LDAP_Type = { -#if defined(MS_WINDOWS) || defined(__CYGWIN__) - /* see http://www.python.org/doc/FAQ.html#3.24 */ PyVarObject_HEAD_INIT(NULL, 0) -#else /* ! MS_WINDOWS */ - PyVarObject_HEAD_INIT(&PyType_Type, 0) -#endif /* MS_WINDOWS */ "LDAP", /*tp_name*/ sizeof(LDAPObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ diff --git a/Modules/ldapmodule.c b/Modules/ldapmodule.c index ec3a264..bd54313 100644 --- a/Modules/ldapmodule.c +++ b/Modules/ldapmodule.c @@ -41,9 +41,9 @@ PyObject* init_ldap_module() { PyObject *m, *d; -#if defined(MS_WINDOWS) || defined(__CYGWIN__) - LDAP_Type.ob_type = &PyType_Type; -#endif + /* Initialize LDAP class */ + if (PyType_Ready(&LDAP_Type) < 0) + return NULL; /* Create the module and add the functions */ #if PY_MAJOR_VERSION >= 3 @@ -59,8 +59,6 @@ PyObject* init_ldap_module() m = Py_InitModule("_ldap", methods); #endif - PyType_Ready(&LDAP_Type); - /* Add some symbolic constants to the module */ d = PyModule_GetDict(m);