Since Py3.11 the methods names setstate and getstate conflict with the method names added to the object class.
In the FreeCAD dev (0.22 and more) the methods named setstate and getstate have been renamed to 'loads' and 'dumps'. This have been published in the FreeCAD App: Fixe #10460
This patch add a test of FreeCAD version, and if it's >0.22, expose the 'loads' and 'dumps' methods, if the version is less than 0.22, the __setstate__ and __getstate__ methods are exposed.
This path have been tested on Linux (Debian 12.2 / FreeCAD dev 0.22) and Windows 10, FreeCAD 0.20 & 0.21
Since Py3.11 the methods names setstate and getstate conflict with the method names added to the object class. In the FreeCAD dev (0.22 and more) the methods named setstate and getstate have been renamed to 'loads' and 'dumps'. This have been published in the FreeCAD App: Fixe #10460
This patch add a test of FreeCAD version, and if it's >0.22, expose the 'loads' and 'dumps' methods, if the version is less than 0.22, the __setstate__ and __getstate__ methods are exposed.
This path have been tested on Linux (Debian 12.2 / FreeCAD dev 0.22) and Windows 10, FreeCAD 0.20 & 0.21
@++; Gauthier.