App: fixes #10460: App::PropertyPythonObject is not saving data
Since Py3.11 the methods names __setstate__ and __getstate__ conflict with the method names added to the object class. Thus rename them to 'loads' and 'dumps'
This commit is contained in:
@@ -443,13 +443,13 @@ class ViewProviderJoint:
|
||||
|
||||
return ":/icons/Assembly_CreateJoint.svg"
|
||||
|
||||
def __getstate__(self):
|
||||
def dumps(self):
|
||||
"""When saving the document this object gets stored using Python's json module.\
|
||||
Since we have some un-serializable parts here -- the Coin stuff -- we must define this method\
|
||||
to return a tuple of all serializable objects or None."""
|
||||
return None
|
||||
|
||||
def __setstate__(self, state):
|
||||
def loads(self, state):
|
||||
"""When restoring the serialized object from document we have the chance to set some internals here.\
|
||||
Since no data were serialized nothing needs to be done here."""
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user