Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-with-pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']

runs-on: ${{ matrix.os }}

Expand Down
5 changes: 4 additions & 1 deletion apptools/persistence/state_pickler.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,14 @@ def _do_instance(self, value):
args = value.__getinitargs__()

# Get the object state.
state = None
if hasattr(value, "__get_pure_state__"):
state = value.__get_pure_state__()
elif hasattr(value, "__getstate__"):
# Note that __getstate__() may return None in Python >= 3.11
state = value.__getstate__()
else:

if state is None:
state = value.__dict__

state.pop("__traits_version__", None)
Expand Down
1 change: 1 addition & 0 deletions docs/releases/upcoming/328.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix StatePickler for Python 3.11. (#328)