summaryrefslogtreecommitdiffstats
path: root/Modules/audioop.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-06-11 05:26:20 (GMT)
commit1a21451b1d73b65af949193208372e86bf308411 (patch)
tree8e98d7be9e249b011ae9380479656e5284ec0234 /Modules/audioop.c
parentcdf94635d7e364f9ce1905bafa5b540f4d16147c (diff)
downloadcpython-1a21451b1d73b65af949193208372e86bf308411.zip
cpython-1a21451b1d73b65af949193208372e86bf308411.tar.gz
cpython-1a21451b1d73b65af949193208372e86bf308411.tar.bz2
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Modules/audioop.c')
-rw-r--r--Modules/audioop.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index 7f1e34b..57f25c6 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -1600,17 +1600,31 @@ static PyMethodDef audioop_methods[] = {
{ 0, 0 }
};
+
+static struct PyModuleDef audioopmodule = {
+ PyModuleDef_HEAD_INIT,
+ "audioop",
+ NULL,
+ -1,
+ audioop_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
PyMODINIT_FUNC
-initaudioop(void)
+PyInit_audioop(void)
{
PyObject *m, *d;
- m = Py_InitModule("audioop", audioop_methods);
+ m = PyModule_Create(&audioopmodule);
if (m == NULL)
- return;
+ return NULL;
d = PyModule_GetDict(m);
if (d == NULL)
- return;
+ return NULL;
AudioopError = PyErr_NewException("audioop.error", NULL, NULL);
if (AudioopError != NULL)
PyDict_SetItemString(d,"error",AudioopError);
+ return m;
}