Expression: fix python object evaluation
This commit is contained in:
@@ -2350,6 +2350,13 @@ Expression* PyObjectExpression::_copy() const
|
||||
return new PyObjectExpression(owner,pyObj,false);
|
||||
}
|
||||
|
||||
boost::any PyObjectExpression::getValueAsAny() const {
|
||||
if(!pyObj || pyObj == Py_None)
|
||||
return boost::any();
|
||||
Base::PyGILStateLocker lock;
|
||||
return App::any(pyObjectWrap(pyObj));
|
||||
}
|
||||
|
||||
//
|
||||
// StringExpression class
|
||||
//
|
||||
|
||||
@@ -529,6 +529,7 @@ public:
|
||||
void setPyObject(PyObject *pyobj, bool owned=false);
|
||||
|
||||
virtual std::string toString(bool) const;
|
||||
virtual boost::any getValueAsAny() const;
|
||||
|
||||
virtual Expression * eval() const { return copy(); }
|
||||
virtual Expression * simplify() const { return copy(); }
|
||||
|
||||
Reference in New Issue
Block a user