File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1+ Port _posixshmem extension module to multiphase initialization (:pep: `489 `)
Original file line number Diff line number Diff line change @@ -110,21 +110,17 @@ static PyMethodDef module_methods[ ] = {
110110};
111111
112112
113- static struct PyModuleDef this_module = {
114- PyModuleDef_HEAD_INIT , // m_base
115- "_posixshmem" , // m_name
116- "POSIX shared memory module" , // m_doc
117- -1 , // m_size (space allocated for module globals)
118- module_methods , // m_methods
113+ static struct PyModuleDef _posixshmemmodule = {
114+ PyModuleDef_HEAD_INIT ,
115+ . m_name = "_posixshmem" ,
116+ . m_doc = "POSIX shared memory module" ,
117+ . m_size = 0 ,
118+ . m_methods = module_methods ,
119119};
120120
121121/* Module init function */
122122PyMODINIT_FUNC
123- PyInit__posixshmem (void ) {
124- PyObject * module ;
125- module = PyModule_Create (& this_module );
126- if (!module ) {
127- return NULL ;
128- }
129- return module ;
123+ PyInit__posixshmem (void )
124+ {
125+ return PyModuleDef_Init (& _posixshmemmodule );
130126}
You can’t perform that action at this time.
0 commit comments