Skip to content

Commit

Permalink
bpo-1635741: Port _string module to multi-phase init (GH-22148)
Browse files Browse the repository at this point in the history
Port the _string extension module to the multi-phase initialization
API (PEP 489).
  • Loading branch information
vstinner committed Sep 8, 2020
1 parent 52a2df1 commit bb083d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Port the ``_string`` extension module to the multi-phase initialization API
(:pep:`489`).
14 changes: 5 additions & 9 deletions Objects/unicodeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -16243,20 +16243,16 @@ static PyMethodDef _string_methods[] = {

static struct PyModuleDef _string_module = {
PyModuleDef_HEAD_INIT,
"_string",
PyDoc_STR("string helper module"),
0,
_string_methods,
NULL,
NULL,
NULL,
NULL
.m_name = "_string",
.m_doc = PyDoc_STR("string helper module"),
.m_size = 0,
.m_methods = _string_methods,
};

PyMODINIT_FUNC
PyInit__string(void)
{
return PyModule_Create(&_string_module);
return PyModuleDef_Init(&_string_module);
}


Expand Down

0 comments on commit bb083d3

Please sign in to comment.