Skip to content

Commit

Permalink
bpo-1635741: Port _ctypes_test extension to multiphase initialization…
Browse files Browse the repository at this point in the history
… (PEP 489) (GH-19012)
  • Loading branch information
shihai1991 authored Mar 17, 2020
1 parent 6ff79f6 commit 2037502
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Modules/_ctypes/_ctypes_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

0 comments on commit 2037502

Please sign in to comment.