Skip to content

Commit 0acabb0

Browse files
authored
Merge pull request #330 from bgilbert/multiphase
convert: switch to multi-phase module initialization
2 parents abd51f6 + 442f91b commit 0acabb0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

openslide/_convert.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,22 +96,27 @@ _convert_argb2rgba(PyObject *self, PyObject *args)
9696
return ret;
9797
}
9898

99-
static PyMethodDef ConvertMethods[] = {
99+
static PyMethodDef _convert_methods[] = {
100100
{"argb2rgba", _convert_argb2rgba, METH_VARARGS,
101101
"Convert aRGB to RGBA in place."},
102102
{NULL, NULL, 0, NULL}
103103
};
104104

105-
static struct PyModuleDef convertmodule = {
105+
static PyModuleDef_Slot _convert_slots[] = {
106+
{0, NULL}
107+
};
108+
109+
static struct PyModuleDef _convert_module = {
106110
PyModuleDef_HEAD_INIT,
107111
"_convert",
108112
NULL,
109113
0,
110-
ConvertMethods
114+
_convert_methods,
115+
_convert_slots,
111116
};
112117

113118
PyMODINIT_FUNC
114119
PyInit__convert(void)
115120
{
116-
return PyModule_Create2(&convertmodule, PYTHON_API_VERSION);
121+
return PyModuleDef_Init(&_convert_module);
117122
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy