Skip to content

Commit 2037502

Browse files
authored
bpo-1635741: Port _ctypes_test extension to multiphase initialization (PEP 489) (GH-19012)
1 parent 6ff79f6 commit 2037502

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Modules/_ctypes/_ctypes_test.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -1032,14 +1032,17 @@ EXPORT (HRESULT) KeepObject(IUnknown *punk)
10321032

10331033
#endif
10341034

1035+
static struct PyModuleDef_Slot _ctypes_test_slots[] = {
1036+
{0, NULL}
1037+
};
10351038

10361039
static struct PyModuleDef _ctypes_testmodule = {
10371040
PyModuleDef_HEAD_INIT,
10381041
"_ctypes_test",
10391042
NULL,
1040-
-1,
1043+
0,
10411044
module_methods,
1042-
NULL,
1045+
_ctypes_test_slots,
10431046
NULL,
10441047
NULL,
10451048
NULL
@@ -1048,5 +1051,5 @@ static struct PyModuleDef _ctypes_testmodule = {
10481051
PyMODINIT_FUNC
10491052
PyInit__ctypes_test(void)
10501053
{
1051-
return PyModule_Create(&_ctypes_testmodule);
1054+
return PyModuleDef_Init(&_ctypes_testmodule);
10521055
}

0 commit comments

Comments
 (0)