Commit d07eaf17 authored by Raymond Hettinger's avatar Raymond Hettinger

Issue #11875: Alter the previous fix to work better with subclasses

parent 8dfcab08
...@@ -102,7 +102,7 @@ class OrderedDict(dict): ...@@ -102,7 +102,7 @@ class OrderedDict(dict):
'Return state information for pickling' 'Return state information for pickling'
items = [[k, self[k]] for k in self] items = [[k, self[k]] for k in self]
inst_dict = vars(self).copy() inst_dict = vars(self).copy()
for k in vars(self.__class__()): for k in vars(OrderedDict()):
inst_dict.pop(k, None) inst_dict.pop(k, None)
if inst_dict: if inst_dict:
return (self.__class__, (items,), inst_dict) return (self.__class__, (items,), inst_dict)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment