how-lix-os-pkgs/python2/default/test_threads.py

16 lines
230 B
Python
Executable File

#!/bin/python3
# make sure the recursion limit is reached before running out of stack space.
import threading
import sys
def fun(i):
try:
fun(i+1)
except:
sys.exit(0)
t = threading.Thread(target=fun, args=[1])
t.start()