bpo-1635741: Port _statistics module to multiphase initialization (GH-19015)

This commit is contained in:
Dong-hee Na 2020-03-17 00:10:21 +09:00 committed by GitHub
parent 87ec86c425
commit 356c878fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -0,0 +1 @@
Port _statistics module to multiphase initialization (:pep:`489`).

View File

@ -129,13 +129,17 @@ static PyMethodDef statistics_methods[] = {
PyDoc_STRVAR(statistics_doc,
"Accelerators for the statistics module.\n");
static struct PyModuleDef_Slot _statisticsmodule_slots[] = {
{0, NULL}
};
static struct PyModuleDef statisticsmodule = {
PyModuleDef_HEAD_INIT,
"_statistics",
statistics_doc,
-1,
0,
statistics_methods,
NULL,
_statisticsmodule_slots,
NULL,
NULL,
NULL
@ -144,5 +148,5 @@ static struct PyModuleDef statisticsmodule = {
PyMODINIT_FUNC
PyInit__statistics(void)
{
return PyModule_Create(&statisticsmodule);
return PyModuleDef_Init(&statisticsmodule);
}