File tree 2 files changed +10
-13
lines changed
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[ ] = {
110
110
};
111
111
112
112
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 ,
119
119
};
120
120
121
121
/* Module init function */
122
122
PyMODINIT_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 );
130
126
}
You can’t perform that action at this time.
0 commit comments