]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-1635741: Port _ctypes_test extension to multiphase initialization (PEP 489)...
authorHai Shi <shihai1992@gmail.com>
Tue, 17 Mar 2020 01:15:23 +0000 (09:15 +0800)
committerGitHub <noreply@github.com>
Tue, 17 Mar 2020 01:15:23 +0000 (02:15 +0100)
Modules/_ctypes/_ctypes_test.c

index 8fbc22ff2975334af18ae051d096114c79a94b3e..1ccad8e0e3d64d4d42fe36a3e9ba69069e220298 100644 (file)
@@ -1032,14 +1032,17 @@ EXPORT (HRESULT) KeepObject(IUnknown *punk)
 
 #endif
 
+static struct PyModuleDef_Slot _ctypes_test_slots[] = {
+    {0, NULL}
+}; 
 
 static struct PyModuleDef _ctypes_testmodule = {
     PyModuleDef_HEAD_INIT,
     "_ctypes_test",
     NULL,
-    -1,
+    0,
     module_methods,
-    NULL,
+    _ctypes_test_slots,
     NULL,
     NULL,
     NULL
@@ -1048,5 +1051,5 @@ static struct PyModuleDef _ctypes_testmodule = {
 PyMODINIT_FUNC
 PyInit__ctypes_test(void)
 {
-    return PyModule_Create(&_ctypes_testmodule);
+    return PyModuleDef_Init(&_ctypes_testmodule);
 }