ó x”þfc@sFdZddlZddlZddd„ƒYZd„Zdd d„ƒYZd„Zd d!d „ƒYZd „Zd d"d „ƒYZ d„Z dd#d„ƒYZ d„Z d„Z id„Zd„ZdZxqeedƒeedƒeedƒeedƒeedƒeedƒeedƒdeGHedZqÑdS($sAFind the maximum recursion limit that prevents interpreter termination. This script finds the maximum safe recursion limit on a particular platform. If you need to change the recursion limit on your system, this script will tell you a safe upper bound. To use the new limit, call sys.setrecursionlimit(). This module implements several ways to create infinite recursion in Python. Different implementations end up pushing different numbers of C stack frames, depending on how many calls through Python's abstract C API occur. After each round of tests, it prints a message: "Limit of NNNN is fine". The highest printed value of "NNNN" is therefore the highest potentially safe limit for your system (which depends on the OS, architecture, but also the compilation flags). Please note that it is practically impossible to test all possible recursion paths in the interpreter, so the results of this test should not be trusted blindly -- although they give a good hint of which values are reasonable. NOTE: When the C stack space allocated by your system is exceeded due to excessive recursion, exact behaviour depends on the platform, although the interpreter will always fail in a likely brutal way: either a segmentation fault, a MemoryError, or just a silent abort. NB: A program that does not use __methods__ can set a higher limit. iÿÿÿÿNtRecursiveBlowup1cBseZd„ZRS(cCs|jƒdS(N(t__init__(tself((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR$s(t__name__t __module__R(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR#scCstƒS(N(R(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt test_init'stRecursiveBlowup2cBseZd„ZRS(cCs t|ƒS(N(trepr(R((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt__repr__+s(RRR(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR*scCs ttƒƒS(N(RR(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt test_repr.stRecursiveBlowup4cBseZd„ZRS(cCs||S(N((Rtx((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt__add__2s(RRR (((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR 1scCstƒtƒS(N(R (((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyttest_add5stRecursiveBlowup5cBseZd„ZRS(cCs t||ƒS(N(tgetattr(Rtattr((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt __getattr__9s(RRR(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR8scCs tƒjS(N(RR(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt test_getattr<stRecursiveBlowup6cBseZd„ZRS(cCs||d||dS(Nii((Rtitem((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt __getitem__@s(RRR(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyR?scCs tƒdS(Ni(R(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyt test_getitemCscCstƒS(N(t test_recurse(((s9/usr/lib64/python2.7/Tools/scripts/find_recursionlimit.pyRFscCs­yddl}Wntk r)dGHdSXd}xvtjƒD]h}y||}w=Wn1tk r‡x!tdƒD]}|g}qqWnX|j|ddƒ|||s4