Skip to content

Commit bb083d3

Browse files
authored
bpo-1635741: Port _string module to multi-phase init (GH-22148)
Port the _string extension module to the multi-phase initialization API (PEP 489).
1 parent 52a2df1 commit bb083d3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Port the ``_string`` extension module to the multi-phase initialization API
2+
(:pep:`489`).

Objects/unicodeobject.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16243,20 +16243,16 @@ static PyMethodDef _string_methods[] = {
1624316243

1624416244
static struct PyModuleDef _string_module = {
1624516245
PyModuleDef_HEAD_INIT,
16246-
"_string",
16247-
PyDoc_STR("string helper module"),
16248-
0,
16249-
_string_methods,
16250-
NULL,
16251-
NULL,
16252-
NULL,
16253-
NULL
16246+
.m_name = "_string",
16247+
.m_doc = PyDoc_STR("string helper module"),
16248+
.m_size = 0,
16249+
.m_methods = _string_methods,
1625416250
};
1625516251

1625616252
PyMODINIT_FUNC
1625716253
PyInit__string(void)
1625816254
{
16259-
return PyModule_Create(&_string_module);
16255+
return PyModuleDef_Init(&_string_module);
1626016256
}
1626116257

1626216258

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy