diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2008-06-11 05:26:20 (GMT) |
commit | 1a21451b1d73b65af949193208372e86bf308411 (patch) | |
tree | 8e98d7be9e249b011ae9380479656e5284ec0234 /Python/marshal.c | |
parent | cdf94635d7e364f9ce1905bafa5b540f4d16147c (diff) | |
download | cpython-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.c | 19 |
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; } |