Skip to content

bpo-1635741: port scproxy to multi-phase init #22164

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 3 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Port the :mod:`_scproxy` extension module to multi-phase initialization
(:pep:`489`).
22 changes: 9 additions & 13 deletions Modules/_scproxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,32 +231,28 @@ static PyMethodDef mod_methods[] = {
{ 0, 0, 0, 0 }
};

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


static struct PyModuleDef mod_module = {
static struct PyModuleDef _scproxy_module = {
PyModuleDef_HEAD_INIT,
"_scproxy",
NULL,
-1,
mod_methods,
NULL,
NULL,
NULL,
NULL
.m_name = "_scproxy",
.m_size = 0,
.m_methods = mod_methods,
.m_slots = _scproxy_slots,
};


#ifdef __cplusplus
extern "C" {
#endif

PyMODINIT_FUNC
PyInit__scproxy(void)
{
return PyModule_Create(&mod_module);
return PyModuleDef_Init(&_scproxy_module);
}

#ifdef __cplusplus
}
#endif