Skip to content

Commit

Permalink
bpo-1635741: Port _codecs extension module to multiphase initializati…
Browse files Browse the repository at this point in the history
  • Loading branch information
shihai1991 authored Feb 11, 2020
1 parent 4eb9f43 commit 1ea45ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port _codecs extension module to multiphase initialization (:pep:`489`).
10 changes: 7 additions & 3 deletions Modules/_codecsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,13 +1039,17 @@ static PyMethodDef _codecs_functions[] = {
{NULL, NULL} /* sentinel */
};

static PyModuleDef_Slot _codecs_slots[] = {
{0, NULL}
};

static struct PyModuleDef codecsmodule = {
PyModuleDef_HEAD_INIT,
"_codecs",
NULL,
-1,
0,
_codecs_functions,
NULL,
_codecs_slots,
NULL,
NULL,
NULL
Expand All @@ -1054,5 +1058,5 @@ static struct PyModuleDef codecsmodule = {
PyMODINIT_FUNC
PyInit__codecs(void)
{
return PyModule_Create(&codecsmodule);
return PyModuleDef_Init(&codecsmodule);
}

0 comments on commit 1ea45ae

Please sign in to comment.