]> granicus.if.org Git - python/commitdiff
Issue #11875: Alter the previous fix to work better with subclasses
authorRaymond Hettinger <python@rcn.com>
Wed, 20 Apr 2011 00:17:23 +0000 (17:17 -0700)
committerRaymond Hettinger <python@rcn.com>
Wed, 20 Apr 2011 00:17:23 +0000 (17:17 -0700)
Lib/collections.py

index 5ae590763bd8fb1f4accd673c74b9537f952aa55..79912ecba1f2c81ada4850513c05f5c0712ebeab 100644 (file)
@@ -102,7 +102,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)