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 | ecca9993d71841bcea26988c7aafbeb5d504d7a7 (patch) | |
| tree | 33f1d23fa7bcf60f3149d179e665aaf09504c450 /Python/marshal.c | |
| parent | 4c0cd2b3a9de411cfbc9e81be5ee91506c27e661 (diff) | |
| download | cpython-ecca9993d71841bcea26988c7aafbeb5d504d7a7.tar.gz | |
Implement PEP 3121: new module initialization and finalization API.
Diffstat (limited to 'Python/marshal.c')
| -rw-r--r-- | Python/marshal.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index b1c8dd6f3a..d4755c9d67 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; } |
