summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2020-03-17 01:15:23 (GMT)
committerGitHub <noreply@github.com>2020-03-17 01:15:23 (GMT)
commit2037502613471a0a0a0262085cc50adb378ebbad (patch)
tree89fc5558e21405ed2bc04bbc07650a8d49082859 /Modules/_ctypes
parent6ff79f65820031b219622faea8425edaec9a43f3 (diff)
downloadcpython-2037502613471a0a0a0262085cc50adb378ebbad.zip
cpython-2037502613471a0a0a0262085cc50adb378ebbad.tar.gz
cpython-2037502613471a0a0a0262085cc50adb378ebbad.tar.bz2
bpo-1635741: Port _ctypes_test extension to multiphase initialization (PEP 489) (GH-19012)
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/_ctypes_test.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 8fbc22f..1ccad8e 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -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);
}