]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-1635741: Port _crypt extension module to multiphase initialization (PEP 489)...
authorHai Shi <shihai1992@gmail.com>
Mon, 17 Feb 2020 09:11:34 +0000 (17:11 +0800)
committerGitHub <noreply@github.com>
Mon, 17 Feb 2020 09:11:34 +0000 (10:11 +0100)
Misc/NEWS.d/next/Core and Builtins/2020-02-07-12-57-40.bpo-1635741.ySW6gq.rst [new file with mode: 0644]
Modules/_cryptmodule.c

diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-02-07-12-57-40.bpo-1635741.ySW6gq.rst b/Misc/NEWS.d/next/Core and Builtins/2020-02-07-12-57-40.bpo-1635741.ySW6gq.rst
new file mode 100644 (file)
index 0000000..6b35bdc
--- /dev/null
@@ -0,0 +1 @@
+Port _crypt extension module to multiphase initialization (:pep:`489`).
\ No newline at end of file
index 00c1f4f69841b2d5e8815c1d6be2dbd4f8275f6b..a95f55a63c306e3ab724a35d80294f674226dc16 100644 (file)
@@ -54,14 +54,17 @@ static PyMethodDef crypt_methods[] = {
     {NULL,              NULL}           /* sentinel */
 };
 
+static PyModuleDef_Slot _crypt_slots[] = {
+    {0, NULL}
+};
 
 static struct PyModuleDef cryptmodule = {
     PyModuleDef_HEAD_INIT,
     "_crypt",
     NULL,
-    -1,
+    0,
     crypt_methods,
-    NULL,
+    _crypt_slots,
     NULL,
     NULL,
     NULL
@@ -70,5 +73,5 @@ static struct PyModuleDef cryptmodule = {
 PyMODINIT_FUNC
 PyInit__crypt(void)
 {
-    return PyModule_Create(&cryptmodule);
+    return PyModuleDef_Init(&cryptmodule);
 }