summaryrefslogtreecommitdiffstats
path: root/Modules/_heapqmodule.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/_heapqmodule.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/_heapqmodule.c')
-rw-r--r--Modules/_heapqmodule.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c
index a5a5605..9d2bb1a 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -679,15 +679,29 @@ backwards, and this was also used to avoid the rewinding time.\n\
Believe me, real good tape sorts were quite spectacular to watch!\n\
From all times, sorting has always been a Great Art! :-)\n");
+
+static struct PyModuleDef _heapqmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_heapq",
+ module_doc,
+ -1,
+ heapq_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
PyMODINIT_FUNC
-init_heapq(void)
+PyInit__heapq(void)
{
PyObject *m, *about;
- m = Py_InitModule3("_heapq", heapq_methods, module_doc);
+ m = PyModule_Create(&_heapqmodule);
if (m == NULL)
- return;
+ return NULL;
about = PyUnicode_DecodeUTF8(__about__, strlen(__about__), NULL);
PyModule_AddObject(m, "__about__", about);
+ return m;
}