Files
INTUIA/Programa final/Python-3.10.15/Lib/test/crashers/trace_at_recursion_limit.py
T

28 lines
376 B
Python
Raw Normal View History

2026-03-15 13:27:50 +00:00
"""
From http://bugs.python.org/issue6717
A misbehaving trace hook can trigger a segfault by exceeding the recursion
limit.
"""
import sys
def x():
pass
def g(*args):
if True: # change to True to crash interpreter
try:
x()
except:
pass
return g
def f():
print(sys.getrecursionlimit())
f()
sys.settrace(g)
f()