]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-1635741: Port _string module to multi-phase init (GH-22148)
authorVictor Stinner <vstinner@python.org>
Tue, 8 Sep 2020 13:33:08 +0000 (15:33 +0200)
committerGitHub <noreply@github.com>
Tue, 8 Sep 2020 13:33:08 +0000 (15:33 +0200)
Port the _string extension module to the multi-phase initialization
API (PEP 489).

Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst [new file with mode: 0644]
Objects/unicodeobject.c

diff --git a/Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst b/Misc/NEWS.d/next/Library/2020-09-08-13-51-16.bpo-1635741.wkPeoT.rst
new file mode 100644 (file)
index 0000000..972d69b
--- /dev/null
@@ -0,0 +1,2 @@
+Port the ``_string`` extension module to the multi-phase initialization API
+(:pep:`489`).
index 82e09ad05fcd13eee8e1f6a233b2a4c67b27afdc..fd0e8e008adae4cf41885b105143cd56967f21d2 100644 (file)
@@ -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);
 }