Py: replace BaseExceptionFreeCADError with more suitable exception types

This commit is contained in:
wmayer
2022-03-17 13:54:23 +01:00
parent d84fd8a2df
commit d69defaa3c
38 changed files with 148 additions and 133 deletions

View File

@@ -166,7 +166,7 @@ AppExport std::map<std::string,std::string> Application::mConfig;
// Custom Python exception types
BaseExport extern PyObject* Base::BaseExceptionFreeCADError;
BaseExport extern PyObject* Base::BaseExceptionFreeCADAbort;
BaseExport extern PyObject* Base::PyExc_FC_FreeCADAbort;
BaseExport extern PyObject* Base::PyExc_FC_XMLBaseException;
BaseExport extern PyObject* Base::PyExc_FC_XMLParseException;
BaseExport extern PyObject* Base::PyExc_FC_XMLAttributeError;
@@ -365,9 +365,9 @@ void Application::setupPythonException(PyObject* module)
Py_INCREF(Base::BaseExceptionFreeCADError);
PyModule_AddObject(module, "FreeCADError", Base::BaseExceptionFreeCADError);
Base::BaseExceptionFreeCADAbort = PyErr_NewException("Base.FreeCADAbort", PyExc_BaseException, nullptr);
Py_INCREF(Base::BaseExceptionFreeCADAbort);
PyModule_AddObject(module, "FreeCADAbort", Base::BaseExceptionFreeCADAbort);
Base::PyExc_FC_FreeCADAbort = PyErr_NewException("Base.FreeCADAbort", PyExc_BaseException, nullptr);
Py_INCREF(Base::PyExc_FC_FreeCADAbort);
PyModule_AddObject(module, "FreeCADAbort", Base::PyExc_FC_FreeCADAbort);
Base::PyExc_FC_XMLBaseException = PyErr_NewException("Base.XMLBaseException", PyExc_Exception, nullptr);
Py_INCREF(Base::PyExc_FC_XMLBaseException);