Skip to content

Commit

Permalink
[skip ci] App: print affected Python type if serializing via JSON fails
Browse files Browse the repository at this point in the history
FemGui: add default implementations of __getstate__/__setstate__ to _ViewProviderFemResultMechanical
  • Loading branch information
wwmayer committed Mar 10, 2020
1 parent a58ecba commit 75b9dd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/App/PropertyPythonObject.cpp
Expand Up @@ -109,6 +109,8 @@ std::string PropertyPythonObject::toString() const
repr = str.as_std_string("ascii");
}
catch (Py::Exception&) {
Py::String typestr(this->object.type().str());
Base::Console().Error("PropertyPythonObject::toString(): failed for %s\n", typestr.as_string().c_str());
Base::PyException e; // extract the Python error text
e.ReportException();
}
Expand Down
6 changes: 6 additions & 0 deletions src/Mod/Fem/femguiobjects/_ViewProviderFemResultMechanical.py
Expand Up @@ -85,6 +85,12 @@ def onDelete(self, feature, subelements):
FreeCAD.Console.PrintError("Error in onDelete: {0} \n".format(err))
return True

def __getstate__(self):
return None

def __setstate__(self, data):
return None


class _TaskPanel:
"""
Expand Down

0 comments on commit 75b9dd8

Please sign in to comment.