Skip to content

bpo-1635741: Port _crypt extension module to multiphase initialization(PEP 489) #18404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 17, 2020
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port _crypt extension module to multiphase initialization (:pep:`489`).
9 changes: 6 additions & 3 deletions Modules/_cryptmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,17 @@ static PyMethodDef crypt_methods[] = {
{NULL, NULL} /* sentinel */
};

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

static struct PyModuleDef cryptmodule = {
PyModuleDef_HEAD_INIT,
"_crypt",
NULL,
-1,
0,
crypt_methods,
NULL,
_crypt_slots,
NULL,
NULL,
NULL
Expand All @@ -70,5 +73,5 @@ static struct PyModuleDef cryptmodule = {
PyMODINIT_FUNC
PyInit__crypt(void)
{
return PyModule_Create(&cryptmodule);
return PyModuleDef_Init(&cryptmodule);
}