bpo-1635741: Port _codecs extension module to multiphase initialization (PEP 489) (GH-18065)

https://bugs.python.org/issue1635741
This commit is contained in:
Hai Shi 2020-02-11 05:16:38 -06:00 committed by GitHub
parent 4eb9f4313c
commit 1ea45ae257
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 _codecs extension module to multiphase initialization (:pep:`489`).

View File

@ -1039,13 +1039,17 @@ static PyMethodDef _codecs_functions[] = {
{NULL, NULL} /* sentinel */ {NULL, NULL} /* sentinel */
}; };
static PyModuleDef_Slot _codecs_slots[] = {
{0, NULL}
};
static struct PyModuleDef codecsmodule = { static struct PyModuleDef codecsmodule = {
PyModuleDef_HEAD_INIT, PyModuleDef_HEAD_INIT,
"_codecs", "_codecs",
NULL, NULL,
-1, 0,
_codecs_functions, _codecs_functions,
NULL, _codecs_slots,
NULL, NULL,
NULL, NULL,
NULL NULL
@ -1054,5 +1058,5 @@ static struct PyModuleDef codecsmodule = {
PyMODINIT_FUNC PyMODINIT_FUNC
PyInit__codecs(void) PyInit__codecs(void)
{ {
return PyModule_Create(&codecsmodule); return PyModuleDef_Init(&codecsmodule);
} }