import threading import time class WaitMax(threading.Thread): daemon = True def run(self): while True: time.sleep(1) def problem(): wait_max = WaitMax() wait_max.start() wait_max.join(threading.TIMEOUT_MAX) problem()