]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-1635741: port scproxy to multi-phase init (GH-22164)
authorMohamed Koubaa <koubaa.m@gmail.com>
Wed, 9 Sep 2020 03:28:48 +0000 (22:28 -0500)
committerGitHub <noreply@github.com>
Wed, 9 Sep 2020 03:28:48 +0000 (12:28 +0900)
Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst [new file with mode: 0644]
Modules/_scproxy.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst b/Misc/NEWS.d/next/Core and Builtins/2020-09-08-20-39-43.bpo-1635741.jiXmyT.rst
new file mode 100644 (file)
index 0000000..17752b2
--- /dev/null
@@ -0,0 +1,2 @@
+Port the :mod:`_scproxy` extension module to multi-phase initialization\r
+(:pep:`489`).\r
index dbee3f7367edeb0c397cceccb3b31d836ce4e62e..4c1f1aa300c7172474a334af4150106b3d659bdc 100644 (file)
@@ -231,21 +231,18 @@ static PyMethodDef mod_methods[] = {
     { 0, 0, 0, 0 }
 };
 
+static PyModuleDef_Slot _scproxy_slots[] = {
+    {0, NULL}
+};
 
-
-static struct PyModuleDef mod_module = {
+static struct PyModuleDef _scproxy_module = {
     PyModuleDef_HEAD_INIT,
-    "_scproxy",
-    NULL,
-    -1,
-    mod_methods,
-    NULL,
-    NULL,
-    NULL,
-    NULL
+    .m_name = "_scproxy",
+    .m_size = 0,
+    .m_methods = mod_methods,
+    .m_slots = _scproxy_slots,
 };
 
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -253,10 +250,9 @@ extern "C" {
 PyMODINIT_FUNC
 PyInit__scproxy(void)
 {
-    return PyModule_Create(&mod_module);
+    return PyModuleDef_Init(&_scproxy_module);
 }
 
 #ifdef __cplusplus
 }
 #endif
-