summaryrefslogtreecommitdiff
path: root/Modules/fcntlmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 +0000
committerMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 +0000
commit1a21451b1d73b65af949193208372e86bf308411 (patch)
tree8e98d7be9e249b011ae9380479656e5284ec0234 /Modules/fcntlmodule.c
parentcdf94635d7e364f9ce1905bafa5b540f4d16147c (diff)
downloadcpython-git-1a21451b1d73b65af949193208372e86bf308411.tar.gz
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Modules/fcntlmodule.c')
-rw-r--r--Modules/fcntlmodule.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/Modules/fcntlmodule.c b/Modules/fcntlmodule.c
index 9acfece0c0..353889c429 100644
--- a/Modules/fcntlmodule.c
+++ b/Modules/fcntlmodule.c
@@ -599,17 +599,31 @@ all_ins(PyObject* d)
return 0;
}
+
+static struct PyModuleDef fcntlmodule = {
+ PyModuleDef_HEAD_INIT,
+ "fcntl",
+ module_doc,
+ -1,
+ fcntl_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
PyMODINIT_FUNC
-initfcntl(void)
+PyInit_fcntl(void)
{
PyObject *m, *d;
/* Create the module and add the functions and documentation */
- m = Py_InitModule3("fcntl", fcntl_methods, module_doc);
+ m = PyModule_Create(&fcntlmodule);
if (m == NULL)
- return;
+ return NULL;
/* Add some symbolic constants to the module */
d = PyModule_GetDict(m);
all_ins(d);
+ return m;
}