Skip to content

Commit f12640d

Browse files
Improve pickling...
1 parent 6416366 commit f12640d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

matplotview/_view_axes.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,13 @@ def set_linescaling(self, value: bool):
267267
def __reduce__(self):
268268
builder, args = super().__reduce__()[:2]
269269

270-
if(type(self) in args):
271-
builder = super().__new__
272-
args = (type(self).__bases__[0],)
270+
if(self.__new__ == builder):
271+
builder = super().__new__()
272+
273+
cls = type(self)
274+
args = tuple(
275+
arg if(arg != cls) else cls.__bases__[0] for arg in args
276+
)
273277

274278
return (
275279
_view_from_pickle,

0 commit comments

Comments
 (0)