mirror of https://github.com/python/cpython
Issue #11875: Alter the previous fix to work better with subclasses
This commit is contained in:
commit
25458f155a
|
@ -155,7 +155,7 @@ class OrderedDict(dict):
|
|||
'Return state information for pickling'
|
||||
items = [[k, self[k]] for k in self]
|
||||
inst_dict = vars(self).copy()
|
||||
for k in vars(self.__class__()):
|
||||
for k in vars(OrderedDict()):
|
||||
inst_dict.pop(k, None)
|
||||
if inst_dict:
|
||||
return (self.__class__, (items,), inst_dict)
|
||||
|
|
Loading…
Reference in New Issue