fixes in mod Assembly for python3

This commit is contained in:
Fabio Rossi
2018-07-13 10:28:19 +02:00
committed by Yorik van Havre
parent 163232f623
commit 1a4d095a6a
2 changed files with 18 additions and 0 deletions

View File

@@ -57,7 +57,16 @@ void AssemblyExport initAssembly()
PyErr_SetString(PyExc_ImportError, e.what());
return;
}
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef AssemblyAPIDef = {
PyModuleDef_HEAD_INIT,
"Assembly", module_Assembly_doc, -1, Assembly_methods,
NULL, NULL, NULL, NULL
};
PyModule_Create(&AssemblyAPIDef);
#else
Py_InitModule3("Assembly", Assembly_methods, module_Assembly_doc); /* mod name, table ptr */
#endif
Base::Console().Log("Loading Assembly module... done\n");