Gui: handle exception in property item display

This commit is contained in:
Zheng, Lei
2019-12-26 18:34:05 +08:00
committed by Chris Hennes
parent df6a7e4a56
commit b76509bfea

View File

@@ -350,10 +350,8 @@ QVariant PropertyItem::toString(const QVariant& prop) const
std::ostringstream ss;
Base::PyGILStateLocker lock;
try {
Base::PyGILStateLocker lock;
Py::Object pyobj(propertyItems[0]->getPyObject(), true);
std::ostringstream ss;
if (pyobj.isNone()) {
Py::Object pyobj(propertyItems[0]->getPyObject(),true);
if(pyobj.isNone()) {
ss << "<None>";
}
else if(pyobj.isSequence()) {
@@ -393,6 +391,7 @@ QVariant PropertyItem::toString(const QVariant& prop) const
}
else
ss << pyobj.as_string();
} catch (Py::Exception &) {
Base::PyException e;
ss.str("");