Merge "fm-common: updated initfm_core to PyInit_fm_core"

This commit is contained in:
Zuul 2021-08-16 19:53:59 +00:00 committed by Gerrit Code Review
commit 53977f2898
1 changed files with 14 additions and 1 deletions

View File

@ -313,8 +313,21 @@ static PyMethodDef _methods [] = {
{ NULL, NULL, 0, NULL }
};
static struct PyModuleDef cModPyDem =
{
PyModuleDef_HEAD_INIT,
"fm_core", /* name of module */
"", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */
_methods
};
#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_fm_core() {
#else
PyMODINIT_FUNC initfm_core() {
PyObject *m = Py_InitModule("fm_core", _methods);
#endif
PyObject *m = PyModule_Create(&cModPyDem);
if (m == NULL){
PySys_WriteStderr("Failed to initialize fm_core");
return;