#!/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()