diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-23 17:12:25 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-23 17:12:25 (GMT) |
commit | e6d4c5bab8d18e32bba6482da1b603b35f2fe254 (patch) | |
tree | b2d2dfb60696e0c9e0a36c903f14c458a0dda1fe /Tools/scripts/find_recursionlimit.py | |
parent | 0929b1fc70e2f3fd1c4550ebbcaa4e733f5a8f7a (diff) | |
download | cpython-e6d4c5bab8d18e32bba6482da1b603b35f2fe254.zip cpython-e6d4c5bab8d18e32bba6482da1b603b35f2fe254.tar.gz cpython-e6d4c5bab8d18e32bba6482da1b603b35f2fe254.tar.bz2 |
Issue #10987: Fix the recursion limit handling in the _pickle module.
Diffstat (limited to 'Tools/scripts/find_recursionlimit.py')
-rw-r--r-- | Tools/scripts/find_recursionlimit.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/scripts/find_recursionlimit.py b/Tools/scripts/find_recursionlimit.py index b299bf5..443f052 100644 --- a/Tools/scripts/find_recursionlimit.py +++ b/Tools/scripts/find_recursionlimit.py @@ -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 |