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:
wmayer
2023-09-22 16:06:21 +02:00
committed by Chris Hennes
parent 97d84ec184
commit 83d4080fe8
75 changed files with 227 additions and 227 deletions

View File

@@ -76,7 +76,7 @@ class Text(DraftAnnotation):
"""Execute code when the document is restored."""
super().onDocumentRestored(obj)
# See __setstate__: self.Type is None for new objects.
# See loads: self.Type is None for new objects.
if self.Type is not None \
and hasattr(obj, "ViewObject") \
and obj.ViewObject:
@@ -93,7 +93,7 @@ class Text(DraftAnnotation):
_wrn("v0.21, " + obj.Label + ", "
+ translate("draft", "renamed 'DisplayMode' options to 'World/Screen'"))
def __setstate__(self,state):
def loads(self,state):
# Before update_properties_0v21 the self.Type value was stored.
# We use this to identify older objects that need to be updated.
self.Type = state