mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 88147 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88147 | antoine.pitrou | 2011-01-23 18:12:25 +0100 (dim., 23 janv. 2011) | 3 lines Issue #10987: Fix the recursion limit handling in the _pickle module. ........
This commit is contained in:
parent
eb9d5ad6ba
commit
0f2a61a11e
3 changed files with 20 additions and 7 deletions
|
@ -77,14 +77,15 @@ def test_cpickle(_cache={}):
|
|||
except ImportError:
|
||||
print("cannot import _pickle, skipped!")
|
||||
return
|
||||
l = None
|
||||
k, l = None, None
|
||||
for n in itertools.count():
|
||||
try:
|
||||
l = _cache[n]
|
||||
continue # Already tried and it works, let's save some time
|
||||
except KeyError:
|
||||
for i in range(100):
|
||||
l = [l]
|
||||
l = [k, l]
|
||||
k = {i: l}
|
||||
_pickle.Pickler(io.BytesIO(), protocol=-1).dump(l)
|
||||
_cache[n] = l
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue