Gui: remove Py2 code from several src/Gui .cpp files

This commit is contained in:
luz paz
2021-04-12 10:56:27 -04:00
committed by wmayer
parent b7a15767e9
commit 6a7184139d
10 changed files with 1 additions and 191 deletions

View File

@@ -377,7 +377,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
// is started in command mode
if (Base::Type::fromName("Gui::BaseView").isBad())
Gui::Application::initApplication();
#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef FreeCADGuiModuleDef = {
PyModuleDef_HEAD_INIT,
"FreeCADGui", "FreeCAD GUI module\n", -1,
@@ -386,9 +385,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
};
PyObject* module = PyModule_Create(&FreeCADGuiModuleDef);
return module;
#else
Py_InitModule3("FreeCADGui", FreeCADGui_methods, "FreeCAD GUI module\n");
#endif
}
catch (const Base::Exception& e) {
PyErr_Format(PyExc_ImportError, "%s\n", e.what());
@@ -396,8 +392,6 @@ PyMOD_INIT_FUNC(FreeCADGui)
catch (...) {
PyErr_SetString(PyExc_ImportError, "Unknown runtime error occurred");
}
#if PY_MAJOR_VERSION >= 3
return 0;
#endif
}