diff --git a/Lib/collections/__init__.py b/Lib/collections/__init__.py index ca92c3cc91b..e7441d25898 100644 --- a/Lib/collections/__init__.py +++ b/Lib/collections/__init__.py @@ -281,6 +281,10 @@ def __getnewargs__(self): 'Return self as a plain tuple. Used by copy and pickle.' return tuple(self) + def __getstate__(self): + 'Exclude the OrderedDict from pickling' + return None + {field_defs} ''' diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index dfad78e0056..80330312594 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -305,6 +305,7 @@ def test_pickle(self): q = loads(dumps(p, protocol)) self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) + self.assertNotIn(b'OrderedDict', dumps(p, protocol)) def test_copy(self): p = TestNT(x=10, y=20, z=30) diff --git a/Misc/ACKS b/Misc/ACKS index 2509aaa517d..2bb0e68ca8f 100644 --- a/Misc/ACKS +++ b/Misc/ACKS @@ -829,6 +829,7 @@ Trent Mick Jason Michalski Franck Michea Tom Middleton +Thomas Miedema Stan Mihai Stefan Mihaila Aristotelis Mikropoulos