mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-11 00:32:27 +03:00
Use multi-phase initialization
This commit is contained in:
parent
b5d64e8576
commit
ccca015977
|
@ -616,22 +616,22 @@ setup_module(PyObject *m) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyModuleDef_Slot slots[] = {
|
||||||
|
{Py_mod_exec, setup_module},
|
||||||
|
#ifdef Py_GIL_DISABLED
|
||||||
|
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||||
|
#endif
|
||||||
|
{0, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit__jpegxl(void) {
|
PyInit__jpegxl(void) {
|
||||||
PyObject *m;
|
|
||||||
|
|
||||||
static PyModuleDef module_def = {
|
static PyModuleDef module_def = {
|
||||||
PyModuleDef_HEAD_INIT,
|
PyModuleDef_HEAD_INIT,
|
||||||
.m_name = "_jpegxl",
|
.m_name = "_jpegxl",
|
||||||
.m_size = -1,
|
|
||||||
.m_methods = jpegxlMethods,
|
.m_methods = jpegxlMethods,
|
||||||
|
.m_slots = slots
|
||||||
};
|
};
|
||||||
|
|
||||||
m = PyModule_Create(&module_def);
|
return PyModuleDef_Init(&module_def);
|
||||||
if (setup_module(m) < 0) {
|
|
||||||
Py_DECREF(m);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return m;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user