summaryrefslogtreecommitdiffstats
path: root/Python/marshal.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 /Python/marshal.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 'Python/marshal.c')
-rw-r--r--Python/marshal.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index b1c8dd6..d4755c9 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1191,11 +1191,26 @@ static PyMethodDef marshal_methods[] = {
{NULL, NULL} /* sentinel */
};
+static struct PyModuleDef impmodule = {
+ PyModuleDef_HEAD_INIT,
+ "marshal",
+ NULL,
+ 0,
+ marshal_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+
+
PyMODINIT_FUNC
PyMarshal_Init(void)
{
- PyObject *mod = Py_InitModule("marshal", marshal_methods);
+ PyObject *mod = PyModule_Create(&impmodule);
if (mod == NULL)
- return;
+ return NULL;
PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION);
+ return mod;
}