import time def call(fn, *args): for i in range(10): try: return fn(*args) except: time.sleep(i) return None