summaryrefslogtreecommitdiffstats
path: root/Modules/nismodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/nismodule.c')
-rw-r--r--Modules/nismodule.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/Modules/nismodule.c b/Modules/nismodule.c
index bf2d185..3af394d 100644
--- a/Modules/nismodule.c
+++ b/Modules/nismodule.c
@@ -430,15 +430,28 @@ static PyMethodDef nis_methods[] = {
PyDoc_STRVAR(nis__doc__,
"This module contains functions for accessing NIS maps.\n");
-void
-initnis (void)
+static struct PyModuleDef nismodule = {
+ PyModuleDef_HEAD_INIT,
+ "nis",
+ nis__doc__,
+ -1,
+ nis_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyObject*
+PyInit_nis (void)
{
PyObject *m, *d;
- m = Py_InitModule3("nis", nis_methods, nis__doc__);
+ m = PyModule_Create(&nismodule);
if (m == NULL)
- return;
+ return NULL;
d = PyModule_GetDict(m);
NisError = PyErr_NewException("nis.error", NULL, NULL);
if (NisError != NULL)
PyDict_SetItemString(d, "error", NisError);
+ return m;
}