mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-30 04:33:00 +02:00
11 lines
218 B
Python
11 lines
218 B
Python
import time
|
|
|
|
def until(fn, attempts=10, interval=1):
|
|
for attempt in range(attempts):
|
|
if fn():
|
|
return
|
|
|
|
time.sleep(interval)
|
|
|
|
raise Exception("Expected condition did not materialize")
|