summaryrefslogtreecommitdiffstats
path: root/Lib/test/pickletester.py
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2009-05-26 16:53:41 (GMT)
committerCollin Winter <collinw@gmail.com>2009-05-26 16:53:41 (GMT)
commit8ca69de23772af21a2e697ab7e73a72e29ef178d (patch)
tree54e028000dae9438b3b4dec93e1333baafaa07e8 /Lib/test/pickletester.py
parent7d5285ec79ef0f907ade0f110a008694441a97e3 (diff)
downloadcpython-8ca69de23772af21a2e697ab7e73a72e29ef178d.zip
cpython-8ca69de23772af21a2e697ab7e73a72e29ef178d.tar.gz
cpython-8ca69de23772af21a2e697ab7e73a72e29ef178d.tar.bz2
Merged revisions 72930 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72930 | collin.winter | 2009-05-25 21:12:39 -0700 (Mon, 25 May 2009) | 1 line Issue 5794: fix cPickle's unpickling of recursive tuples. ........
Diffstat (limited to 'Lib/test/pickletester.py')
-rw-r--r--Lib/test/pickletester.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py
index 1585586..58ce3b5 100644
--- a/Lib/test/pickletester.py
+++ b/Lib/test/pickletester.py
@@ -432,6 +432,16 @@ class AbstractPickleTests(unittest.TestCase):
self.assertEqual(len(x), 1)
self.assert_(x is x[0])
+ def test_recursive_tuple(self):
+ t = ([],)
+ t[0].append(t)
+ for proto in protocols:
+ s = self.dumps(t, proto)
+ x = self.loads(s)
+ self.assertEqual(len(x), 1)
+ self.assertEqual(len(x[0]), 1)
+ self.assert_(x is x[0][0])
+
def test_recursive_dict(self):
d = {}
d[1] = d