Skip to content

Commit b5dca62

Browse files
committed
fix(polys): fix pickling of poly objects for Python 3.11
This is needed after the changes in python/cpython#70766 Since object now has a __getstate__ method we need to make sure not to call it with any arguments. Probably the __getstate__ methods can be simplified (or removed?) in light of the cpython changes but for now this is a quick fix to restore previous behaviour.
1 parent 20e59b8 commit b5dca62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sympy/polys/polyutils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def __getstate__(self, cls=None):
470470

471471
# Get all data that should be stored from super classes
472472
for c in cls.__bases__:
473-
if hasattr(c, "__getstate__"):
473+
if d is not object and hasattr(c, "__getstate__"):
474474
d.update(c.__getstate__(self, c))
475475

476476
# Get all information that should be stored from cls and return the dict

0 commit comments

Comments
 (0)