Now all objects define __getstate__ (with default value None)
Previous logic in project.save() would test for existence of that method, and if present, use it to populate a state variable.
This no longer works, because a None value passes the first test (it exists) but it is obviously not callable.
This small patch adds support for Python 3.11+ by also checking that __getstate__ is not None before attempting to call it.
Now all objects define
__getstate__
(with default valueNone
)Previous logic in
project.save()
would test for existence of that method, and if present, use it to populate a state variable. This no longer works, because aNone
value passes the first test (it exists) but it is obviously not callable. This small patch adds support for Python 3.11+ by also checking that__getstate__
is notNone
before attempting to call it.