summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/collections.py4
-rw-r--r--Lib/test/test_collections.py1
2 files changed, 5 insertions, 0 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index eb20243..33aedd9 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -281,6 +281,10 @@ class {typename}(tuple):
'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 b2a5f05..c18256b 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -272,6 +272,7 @@ class TestNamedTuple(unittest.TestCase):
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)