Skip to content

Commit

Permalink
fix(polys): fix pickling of poly objects for Python 3.11
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oscarbenjamin committed May 16, 2022
1 parent 20e59b8 commit b5dca62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sympy/polys/polyutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def __getstate__(self, cls=None):

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

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

0 comments on commit b5dca62

Please sign in to comment.