mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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. ........
This commit is contained in:
parent
7d5285ec79
commit
8ca69de237
2 changed files with 18 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue