bpo-1635741: port scproxy to multi-phase init (GH-22164) · python/cpython@3ff6975

File tree

2 files changed

lines changed

  • Misc/NEWS.d/next/Core and Builtins

2 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -0,0 +1,2 @@

1+

Port the :mod:`_scproxy` extension module to multi-phase initialization

2+

(:pep:`489`).

Original file line numberDiff line numberDiff line change

@@ -231,32 +231,28 @@ static PyMethodDef mod_methods[] = {

231231

{ 0, 0, 0, 0 }

232232

};

233233
234+

static PyModuleDef_Slot _scproxy_slots[] = {

235+

{0, NULL}

236+

};

234237
235-
236-

static struct PyModuleDef mod_module = {

238+

static struct PyModuleDef _scproxy_module = {

237239

PyModuleDef_HEAD_INIT,

238-

"_scproxy",

239-

NULL,

240-

-1,

241-

mod_methods,

242-

NULL,

243-

NULL,

244-

NULL,

245-

NULL

240+

.m_name = "_scproxy",

241+

.m_size = 0,

242+

.m_methods = mod_methods,

243+

.m_slots = _scproxy_slots,

246244

};

247245
248-
249246

#ifdef __cplusplus

250247

extern "C" {

251248

#endif

252249
253250

PyMODINIT_FUNC

254251

PyInit__scproxy(void)

255252

{

256-

return PyModule_Create(&mod_module);

253+

return PyModuleDef_Init(&_scproxy_module);

257254

}

258255
259256

#ifdef __cplusplus

260257

}

261258

#endif

262-