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

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

#countcontent
1n/a"""
2n/aFrom http://bugs.python.org/issue6717
3n/a
4n/aA misbehaving trace hook can trigger a segfault by exceeding the recursion
5n/alimit.
6n/a"""
7n/aimport sys
8n/a
9n/a
10n/adef x():
11n/a pass
12n/a
13n/adef g(*args):
14n/a if True: # change to True to crash interpreter
15n/a try:
16n/a x()
17n/a except:
18n/a pass
19n/a return g
20n/a
21n/adef f():
22n/a print(sys.getrecursionlimit())
23n/a f()
24n/a
25n/asys.settrace(g)
26n/a
27n/af()