Implement PEP 3121: new module initialization and finalization API.
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index b283b0d..1280b04 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -226,10 +226,21 @@
expensive comparison operations, this can be an improvement over the more\n\
common approach.\n");
-PyMODINIT_FUNC
-init_bisect(void)
-{
- PyObject *m;
- m = Py_InitModule3("_bisect", bisect_methods, module_doc);
+static struct PyModuleDef _bisectmodule = {
+ PyModuleDef_HEAD_INIT,
+ "_bisect",
+ module_doc,
+ -1,
+ bisect_methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
+
+PyMODINIT_FUNC
+PyInit__bisect(void)
+{
+ return PyModule_Create(&_bisectmodule);
}