summaryrefslogtreecommitdiffstats
path: root/Modules/_fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_fileio.c')
-rw-r--r--Modules/_fileio.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/Modules/_fileio.c b/Modules/_fileio.c
index 1a78f60..71553ba 100644
--- a/Modules/_fileio.c
+++ b/Modules/_fileio.c
@@ -871,17 +871,29 @@ static PyMethodDef module_methods[] = {
{NULL, NULL}
};
+static struct PyModuleDef fileiomodule = {
+ PyModuleDef_HEAD_INIT,
+ "_fileio",
+ "Fast implementation of io.FileIO.",
+ -1,
+ module_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
PyMODINIT_FUNC
-init_fileio(void)
+PyInit__fileio(void)
{
PyObject *m; /* a module object */
- m = Py_InitModule3("_fileio", module_methods,
- "Fast implementation of io.FileIO.");
+ m = PyModule_Create(&fileiomodule);
if (m == NULL)
- return;
+ return NULL;
if (PyType_Ready(&PyFileIO_Type) < 0)
- return;
+ return NULL;
Py_INCREF(&PyFileIO_Type);
PyModule_AddObject(m, "_FileIO", (PyObject *) &PyFileIO_Type);
+ return m;
}