summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-02-11 11:16:38 (GMT)
committerGitHub <noreply@github.com>2020-02-11 11:16:38 (GMT)
commit1ea45ae257971ee7b648e3b031603a31fc059f81 (patch)
tree25d7874df01e2032505d4da28e7a181f32f3a69b /Modules
parent4eb9f4313cfaea6a9611221024a1c54f5662cc37 (diff)
downloadcpython-1ea45ae257971ee7b648e3b031603a31fc059f81.zip
cpython-1ea45ae257971ee7b648e3b031603a31fc059f81.tar.gz
cpython-1ea45ae257971ee7b648e3b031603a31fc059f81.tar.bz2
bpo-1635741: Port _codecs extension module to multiphase initialization (PEP 489) (GH-18065)
https://bugs.python.org/issue1635741
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_codecsmodule.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Modules/_codecsmodule.c b/Modules/_codecsmodule.c
index a8ffb69..9520721 100644
--- a/Modules/_codecsmodule.c
+++ b/Modules/_codecsmodule.c
@@ -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
@@ -1054,5 +1058,5 @@ static struct PyModuleDef codecsmodule = {
PyMODINIT_FUNC
PyInit__codecs(void)
{
- return PyModule_Create(&codecsmodule);
+ return PyModuleDef_Init(&codecsmodule);
}