get rid of private function _PyImport_FixupBuiltin for FreeCAD and FreeCADGui modules
This commit is contained in:
@@ -345,7 +345,8 @@ Application::Application(bool GUIenabled)
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
// if this returns a valid pointer then the 'FreeCADGui' Python module was loaded,
|
||||
// otherwise the executable was launched
|
||||
PyObject *module = PyImport_AddModule("FreeCADGui");
|
||||
PyObject* modules = PyImport_GetModuleDict();
|
||||
PyObject* module = PyDict_GetItemString(modules, "FreeCADGui");
|
||||
if (!module) {
|
||||
static struct PyModuleDef FreeCADGuiModuleDef = {
|
||||
PyModuleDef_HEAD_INIT,
|
||||
@@ -354,7 +355,8 @@ Application::Application(bool GUIenabled)
|
||||
NULL, NULL, NULL, NULL
|
||||
};
|
||||
module = PyModule_Create(&FreeCADGuiModuleDef);
|
||||
_PyImport_FixupBuiltin(module, "FreeCADGui");
|
||||
|
||||
PyDict_SetItemString(modules, "FreeCADGui", module);
|
||||
}
|
||||
else {
|
||||
// extend the method list
|
||||
|
||||
Reference in New Issue
Block a user