#!/usr/bin/env python3 import concurrent.futures import time def work(): #time.sleep(1) return 1 with concurrent.futures.ThreadPoolExecutor(max_workers=1) as e: f = e.submit(work) #for cf in concurrent.futures.as_completed([f,f]): done, notdone = concurrent.futures.wait([f,f], return_when=concurrent.futures.ALL_COMPLETED) for cf in done: print (cf.result())