File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1552,12 +1552,18 @@ def __str__(self):
1552
1552
return str (self ._child )
1553
1553
1554
1554
def __getstate__ (self ):
1555
- # only store the child
1556
- return {'child' : self ._child }
1555
+ # only store the child and parents
1556
+ return {
1557
+ 'child' : self ._child ,
1558
+ # turn the weakkey dictionary into a normal dictionary
1559
+ 'parents' : dict (six .iteritems (self ._parents ))
1560
+ }
1557
1561
1558
1562
def __setstate__ (self , state ):
1559
1563
# re-initialise the TransformWrapper with the state's child
1560
1564
self ._init (state ['child' ])
1565
+ # turn the normal dictionary back into a WeakValueDictionary
1566
+ self ._parents = WeakValueDictionary (state ['parents' ])
1561
1567
1562
1568
def __repr__ (self ):
1563
1569
return "TransformWrapper(%r)" % self ._child
You can’t perform that action at this time.
0 commit comments