ยปCore Development>Code coverage>Lib/test/crashers/recursion_limit_too_high.py

Python code coverage for Lib/test/crashers/recursion_limit_too_high.py

#countcontent
1n/a# The following example may crash or not depending on the platform.
2n/a# E.g. on 32-bit Intel Linux in a "standard" configuration it seems to
3n/a# crash on Python 2.5 (but not 2.4 nor 2.3). On Windows the import
4n/a# eventually fails to find the module, possibly because we run out of
5n/a# file handles.
6n/a
7n/a# The point of this example is to show that sys.setrecursionlimit() is a
8n/a# hack, and not a robust solution. This example simply exercises a path
9n/a# where it takes many C-level recursions, consuming a lot of stack
10n/a# space, for each Python-level recursion. So 1000 times this amount of
11n/a# stack space may be too much for standard platforms already.
12n/a
13n/aimport sys
14n/aif 'recursion_limit_too_high' in sys.modules:
15n/a del sys.modules['recursion_limit_too_high']
16n/aimport recursion_limit_too_high