diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 +0000 |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 +0000 |
commit | 1a21451b1d73b65af949193208372e86bf308411 (patch) | |
tree | 8e98d7be9e249b011ae9380479656e5284ec0234 /Modules/fcntlmodule.c | |
parent | cdf94635d7e364f9ce1905bafa5b540f4d16147c (diff) | |
download | cpython-git-1a21451b1d73b65af949193208372e86bf308411.tar.gz |
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Modules/fcntlmodule.c')
-rw-r--r-- | Modules/fcntlmodule.c | 20 |
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; } |