diff --git a/src/Base/Exception.cpp b/src/Base/Exception.cpp index f48a799d0e..2ca59f29e5 100644 --- a/src/Base/Exception.cpp +++ b/src/Base/Exception.cpp @@ -98,7 +98,7 @@ void Exception::ReportException (void) const Console().Error("Exception (%s): %s \n",Console().Time(),str.c_str()); } -PyObject * Exception::getPyDict() const +PyObject * Exception::getPyObject(void) const { PyObject *edict = PyDict_New(); @@ -112,7 +112,7 @@ PyObject * Exception::getPyDict() const return edict; } -void Exception::setPyDict( PyObject * pydict) +void Exception::setPyObject( PyObject * pydict) { if(pydict!=NULL) { PyObject *pystring; @@ -283,7 +283,7 @@ void FileException::ReportException (void) const Console().Error("Exception (%s): %s \n",Console().Time(),str.c_str()); } -PyObject * FileException::getPyDict() const +PyObject * FileException::getPyObject(void) const { PyObject *edict = PyDict_New(); @@ -298,7 +298,7 @@ PyObject * FileException::getPyDict() const return edict; } -void FileException::setPyDict( PyObject * pydict) +void FileException::setPyObject( PyObject * pydict) { if(pydict!=NULL) { PyObject *pystring; diff --git a/src/Base/Exception.h b/src/Base/Exception.h index b8cc3d98b8..0661f0e039 100644 --- a/src/Base/Exception.h +++ b/src/Base/Exception.h @@ -85,9 +85,9 @@ public: /// intended to use via macro for autofilling of debugging information inline void setDebugInformation(const std::string & file, const int line, const std::string & function); /// returns a Python dictionary containing the exception data - virtual PyObject * getPyDict() const; + virtual PyObject * getPyObject(void) const; /// returns sets the exception data from a Python dictionary - virtual void setPyDict( PyObject * pydict); + virtual void setPyObject( PyObject * pydict); protected: public: // FIXME: Remove the public keyword @@ -193,9 +193,9 @@ public: /// Get file name for use with tranlatable message std::string getFileName() const; /// returns a Python dictionary containing the exception data - virtual PyObject * getPyDict() const; + virtual PyObject * getPyObject(void) const; /// returns sets the exception data from a Python dictionary - virtual void setPyDict( PyObject * pydict); + virtual void setPyObject( PyObject * pydict); protected: FileInfo file; // necesary for what() legacy behaviour as it returns a buffer that can not be of a temporary object to be destroyed at end of what() diff --git a/src/Base/ExceptionFactory.h b/src/Base/ExceptionFactory.h index 1787839203..7e9384c51d 100644 --- a/src/Base/ExceptionFactory.h +++ b/src/Base/ExceptionFactory.h @@ -80,7 +80,7 @@ public: { CLASS c; - c.setPyDict(pydict); + c.setPyObject(pydict); throw c; } diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index dac3bb98c2..345dc6a5c4 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -494,7 +494,7 @@ PyObject * @self.export.Name@::staticCallback_@i.Name@ (PyObject *self, PyObject } catch(const Base::Exception& e) // catch the FreeCAD exceptions { - PyObject *edict = e.getPyDict(); + PyObject *edict = e.getPyObject(); e.ReportException(); PyErr_SetObject(Base::BaseExceptionFreeCADError, edict); @@ -684,7 +684,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n #ifndef DONT_CATCH_CXX_EXCEPTIONS catch(const Base::Exception& e) // catch the FreeCAD exceptions { - PyObject *edict = e.getPyDict(); + PyObject *edict = e.getPyObject(); e.ReportException(); PyErr_SetObject(Base::BaseExceptionFreeCADError, edict); @@ -714,7 +714,7 @@ PyObject *@self.export.Name@::_getattr(char *attr) // __getattr__ function: n #else // DONT_CATCH_CXX_EXCEPTIONS catch(const Base::Exception& e) // catch the FreeCAD exceptions { - PyObject *edict = e.getPyDict(); + PyObject *edict = e.getPyObject(); e.ReportException(); PyErr_SetObject(Base::BaseExceptionFreeCADError, edict); @@ -757,7 +757,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fun #ifndef DONT_CATCH_CXX_EXCEPTIONS catch(const Base::Exception& e) // catch the FreeCAD exceptions { - PyObject *edict = e.getPyDict(); + PyObject *edict = e.getPyObject(); e.ReportException(); PyErr_SetObject(Base::BaseExceptionFreeCADError, edict); @@ -788,7 +788,7 @@ int @self.export.Name@::_setattr(char *attr, PyObject *value) // __setattr__ fun #else // DONT_CATCH_CXX_EXCEPTIONS catch(const Base::Exception& e) // catch the FreeCAD exceptions { - PyObject *edict = e.getPyDict(); + PyObject *edict = e.getPyObject(); e.ReportException(); PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);