Skip to content

Commit 2afd175

Browse files
authored
bpo-1635741: Port _bisect module to multi-phase init (GH-22415)
1 parent d73cf7c commit 2afd175

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port the :mod:`_bisect` module to the multi-phase initialization API (:pep:`489`).

Modules/_bisectmodule.c

+5-9
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,14 @@ common approach.\n");
237237

238238
static struct PyModuleDef _bisectmodule = {
239239
PyModuleDef_HEAD_INIT,
240-
"_bisect",
241-
module_doc,
242-
-1,
243-
bisect_methods,
244-
NULL,
245-
NULL,
246-
NULL,
247-
NULL
240+
.m_name = "_bisect",
241+
.m_doc = module_doc,
242+
.m_methods = bisect_methods,
243+
.m_size = 0
248244
};
249245

250246
PyMODINIT_FUNC
251247
PyInit__bisect(void)
252248
{
253-
return PyModule_Create(&_bisectmodule);
249+
return PyModuleDef_Init(&_bisectmodule);
254250
}

0 commit comments

Comments
 (0)