bpo-1635741: Port _ctypes_test extension to multiphase initialization (PEP 489) (GH-19012)

This commit is contained in:
Hai Shi 2020-03-17 09:15:23 +08:00 committed by GitHub
parent 6ff79f6582
commit 2037502613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View 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);
}