Cleaner module initialisation.

This commit is contained in:
Raphaël Barrois
2014-03-04 10:50:13 +01:00
committed by Christian Heimes
parent 230d0adc4a
commit 450fcf3f6b

View File

@@ -26,12 +26,8 @@ static PyMethodDef methods[] = {
/* module initialisation */ /* module initialisation */
PyMODINIT_FUNC /* Common initialization code */
#if PY_MAJOR_VERSION >= 3 PyObject* init_ldap_module()
PyInit__ldap()
#else
init_ldap()
#endif
{ {
PyObject *m, *d; PyObject *m, *d;
@@ -71,3 +67,14 @@ init_ldap()
return m; return m;
} }
#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_ldap() {
init_ldap_module();
}
#else
PyMODINIT_FUNC PyInit__ldap() {
return init_ldap_module();
}
#endif