From e6d4c5bab8d18e32bba6482da1b603b35f2fe254 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Sun, 23 Jan 2011 17:12:25 +0000 Subject: Issue #10987: Fix the recursion limit handling in the _pickle module. --- Tools/scripts/find_recursionlimit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Tools/scripts/find_recursionlimit.py') diff --git a/Tools/scripts/find_recursionlimit.py b/Tools/scripts/find_recursionlimit.py index b299bf502a..443f052c4e 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 -- cgit v1.2.1