Merge pull request #15669 from marioalexis84/fem-link_scope_python_objects

Fem: Fix link scope for Python objects
This commit is contained in:
Chris Hennes
2024-08-05 10:53:50 -05:00
committed by GitHub
15 changed files with 144 additions and 58 deletions

View File

@@ -612,6 +612,23 @@ PyObject* AttributeError::getPyExceptionType() const
// ---------------------------------------------------------
PropertyError::PropertyError() = default;
PropertyError::PropertyError(const char* sMessage)
: AttributeError(sMessage)
{}
PropertyError::PropertyError(const std::string& sMessage)
: AttributeError(sMessage)
{}
PyObject* PropertyError::getPyExceptionType() const
{
return PyExc_FC_PropertyError;
}
// ---------------------------------------------------------
RuntimeError::RuntimeError() = default;
RuntimeError::RuntimeError(const char* sMessage)

View File

@@ -670,6 +670,26 @@ public:
PyObject* getPyExceptionType() const override;
};
/**
* The PropertyError can be used to indicate the usage of a wrong property name or value.
* @author Mario Passaglia
*/
class BaseExport PropertyError: public AttributeError
{
public:
/// Construction
PropertyError();
explicit PropertyError(const char* sMessage);
explicit PropertyError(const std::string& sMessage);
PropertyError(const PropertyError&) = default;
PropertyError(PropertyError&&) = default;
/// Destruction
~PropertyError() noexcept override = default;
PropertyError& operator=(const PropertyError&) = default;
PropertyError& operator=(PropertyError&&) = default;
PyObject* getPyExceptionType() const override;
};
/**
* The RuntimeError can be used to indicate an unknown exception at runtime.
* @author Werner Mayer

View File

@@ -48,6 +48,7 @@ PyObject* Base::PyExc_FC_BadGraphError = nullptr;
PyObject* Base::PyExc_FC_ExpressionError = nullptr;
PyObject* Base::PyExc_FC_ParserError = nullptr;
PyObject* Base::PyExc_FC_CADKernelError = nullptr;
PyObject* Base::PyExc_FC_PropertyError = nullptr;
typedef struct { //NOLINT
PyObject_HEAD

View File

@@ -430,6 +430,7 @@ BaseExport extern PyObject* PyExc_FC_BadGraphError;
BaseExport extern PyObject* PyExc_FC_ExpressionError;
BaseExport extern PyObject* PyExc_FC_ParserError;
BaseExport extern PyObject* PyExc_FC_CADKernelError;
BaseExport extern PyObject* PyExc_FC_PropertyError;
/** Exception handling for python callback functions
* Is a convenience macro to manage the exception handling of python callback