mirror of
https://github.com/python/cpython.git
synced 2024-11-24 18:34:43 +08:00
return the module object from PyMODINIT_FUNC
This commit is contained in:
parent
80072cb7fa
commit
71e30a0438
@ -326,8 +326,8 @@ only non-\ ``static`` item defined in the module file::
|
||||
return PyModule_Create(&spammodule);
|
||||
}
|
||||
|
||||
Note that PyMODINIT_FUNC declares the function as ``void`` return type,
|
||||
declares any special linkage declarations required by the platform, and for C++
|
||||
Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return type,
|
||||
declares any special linkage declarations required by the platform, and for C++
|
||||
declares the function as ``extern "C"``.
|
||||
|
||||
When the Python program imports module :mod:`spam` for the first time,
|
||||
|
@ -52,4 +52,5 @@ PyInit_noddy(void)
|
||||
|
||||
Py_INCREF(&noddy_NoddyType);
|
||||
PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType);
|
||||
return m;
|
||||
}
|
||||
|
@ -186,4 +186,5 @@ PyInit_noddy2(void)
|
||||
|
||||
Py_INCREF(&NoddyType);
|
||||
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
|
||||
return m;
|
||||
}
|
||||
|
@ -239,4 +239,5 @@ PyInit_noddy3(void)
|
||||
|
||||
Py_INCREF(&NoddyType);
|
||||
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
|
||||
return m;
|
||||
}
|
||||
|
@ -221,4 +221,5 @@ PyInit_noddy4(void)
|
||||
|
||||
Py_INCREF(&NoddyType);
|
||||
PyModule_AddObject(m, "Noddy", (PyObject *)&NoddyType);
|
||||
return m;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user