bpo-1635741: Port _posixshmem extension module to multiphase initialization (GH-23404)
Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
parent
588c7c9f08
commit
b437aa83f9
|
@ -0,0 +1 @@
|
||||||
|
Port _posixshmem extension module to multiphase initialization (:pep:`489`)
|
|
@ -110,21 +110,17 @@ static PyMethodDef module_methods[ ] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static struct PyModuleDef this_module = {
|
static struct PyModuleDef _posixshmemmodule = {
|
||||||
PyModuleDef_HEAD_INIT, // m_base
|
PyModuleDef_HEAD_INIT,
|
||||||
"_posixshmem", // m_name
|
.m_name = "_posixshmem",
|
||||||
"POSIX shared memory module", // m_doc
|
.m_doc = "POSIX shared memory module",
|
||||||
-1, // m_size (space allocated for module globals)
|
.m_size = 0,
|
||||||
module_methods, // m_methods
|
.m_methods = module_methods,
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Module init function */
|
/* Module init function */
|
||||||
PyMODINIT_FUNC
|
PyMODINIT_FUNC
|
||||||
PyInit__posixshmem(void) {
|
PyInit__posixshmem(void)
|
||||||
PyObject *module;
|
{
|
||||||
module = PyModule_Create(&this_module);
|
return PyModuleDef_Init(&_posixshmemmodule);
|
||||||
if (!module) {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
return module;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue