summaryrefslogtreecommitdiffstats
path: root/Modules/_json.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/_json.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/_json.c')
-rw-r--r--Modules/_json.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/Modules/_json.c b/Modules/_json.c
index cc52ff6..a4308fd 100644
--- a/Modules/_json.c
+++ b/Modules/_json.c
@@ -613,9 +613,20 @@ static PyMethodDef json_methods[] = {
PyDoc_STRVAR(module_doc,
"json speedups\n");
-void
-init_json(void)
+static struct PyModuleDef jsonmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_json",
+ module_doc,
+ -1,
+ json_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyObject*
+PyInit__json(void)
{
- PyObject *m;
- m = Py_InitModule3("_json", json_methods, module_doc);
+ return PyModule_Create(&jsonmodule);
}