Fix GCC warnings: catching polymorphic type by value [-Wcatch-value=]

This commit is contained in:
Mateusz Skowroński
2020-12-28 19:59:14 +01:00
committed by abdullahtahiriyo
parent c89e6eec13
commit 90c4ffceec
3 changed files with 9 additions and 9 deletions

View File

@@ -259,7 +259,7 @@ PyObject* GeometryPy::getExtensionOfType(PyObject *args)
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -296,7 +296,7 @@ PyObject* GeometryPy::getExtensionOfName(PyObject *args)
PyErr_SetString(PartExceptionOCCError, "Geometry extension does not exist anymore.");
return 0;
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
PyErr_SetString(Part::PartExceptionOCCError, "Geometry extension does not implement a Python counterpart.");
return 0;
}
@@ -425,7 +425,7 @@ PyObject* GeometryPy::getExtensions(PyObject *args)
try {
list.append(Py::asObject(p->copyPyObject()));
}
catch(Base::NotImplementedError) {
catch(Base::NotImplementedError&) {
// silently ignoring extensions not having a Python object
}
}