File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -326,8 +326,8 @@ only non-\ ``static`` item defined in the module file::
326326 return PyModule_Create(&spammodule);
327327 }
328328
329- Note that PyMODINIT_FUNC declares the function as ``void `` return type,
330- declares any special linkage declarations required by the platform, and for C++
329+ Note that PyMODINIT_FUNC declares the function as ``PyObject * `` return type,
330+ declares any special linkage declarations required by the platform, and for C++
331331declares the function as ``extern "C" ``.
332332
333333When the Python program imports module :mod: `spam ` for the first time,
Original file line number Diff line number Diff line change @@ -52,4 +52,5 @@ PyInit_noddy(void)
5252
5353 Py_INCREF (& noddy_NoddyType );
5454 PyModule_AddObject (m , "Noddy" , (PyObject * )& noddy_NoddyType );
55+ return m ;
5556}
Original file line number Diff line number Diff line change @@ -186,4 +186,5 @@ PyInit_noddy2(void)
186186
187187 Py_INCREF (& NoddyType );
188188 PyModule_AddObject (m , "Noddy" , (PyObject * )& NoddyType );
189+ return m ;
189190}
Original file line number Diff line number Diff line change @@ -239,4 +239,5 @@ PyInit_noddy3(void)
239239
240240 Py_INCREF (& NoddyType );
241241 PyModule_AddObject (m , "Noddy" , (PyObject * )& NoddyType );
242+ return m ;
242243}
Original file line number Diff line number Diff line change @@ -221,4 +221,5 @@ PyInit_noddy4(void)
221221
222222 Py_INCREF (& NoddyType );
223223 PyModule_AddObject (m , "Noddy" , (PyObject * )& NoddyType );
224+ return m ;
224225}
You can’t perform that action at this time.
0 commit comments