Skip to content

Commit b2b6e27

Browse files
authored
bpo-1635741: Port _crypt extension module to multiphase initialization (PEP 489) (GH-18404)
1 parent d83b660 commit b2b6e27

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port _crypt extension module to multiphase initialization (:pep:`489`).

Modules/_cryptmodule.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,17 @@ static PyMethodDef crypt_methods[] = {
5454
{NULL, NULL} /* sentinel */
5555
};
5656

57+
static PyModuleDef_Slot _crypt_slots[] = {
58+
{0, NULL}
59+
};
5760

5861
static struct PyModuleDef cryptmodule = {
5962
PyModuleDef_HEAD_INIT,
6063
"_crypt",
6164
NULL,
62-
-1,
65+
0,
6366
crypt_methods,
64-
NULL,
67+
_crypt_slots,
6568
NULL,
6669
NULL,
6770
NULL
@@ -70,5 +73,5 @@ static struct PyModuleDef cryptmodule = {
7073
PyMODINIT_FUNC
7174
PyInit__crypt(void)
7275
{
73-
return PyModule_Create(&cryptmodule);
76+
return PyModuleDef_Init(&cryptmodule);
7477
}

0 commit comments

Comments
 (0)