mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-1635741: Port _string module to multi-phase init (GH-22148)
Port the _string extension module to the multi-phase initialization API (PEP 489).
This commit is contained in:
parent
52a2df135c
commit
bb083d33f7
2 changed files with 7 additions and 9 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
Port the ``_string`` extension module to the multi-phase initialization API
|
||||||
|
(:pep:`489`).
|
|
@ -16243,20 +16243,16 @@ static PyMethodDef _string_methods[] = {
|
||||||
|
|
||||||
static struct PyModuleDef _string_module = {
|
static struct PyModuleDef _string_module = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
"_string",
|
.m_name = "_string",
|
||||||
PyDoc_STR("string helper module"),
|
.m_doc = PyDoc_STR("string helper module"),
|
||||||
0,
|
.m_size = 0,
|
||||||
_string_methods,
|
.m_methods = _string_methods,
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit__string(void)
|
PyInit__string(void)
|
||||||
{
|
{
|
||||||
return PyModule_Create(&_string_module);
|
return PyModuleDef_Init(&_string_module);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue