weblib.control¶
-
weblib.control.repeat(func, limit=3, args=None, kwargs=None, fatal_exceptions=(), valid_exceptions=())[source]¶ Return value of execution func function.
In case of error try to execute func maximum limit times and then raise latest exception.
Example:
def download(url): return urllib.urlopen(url).read() data = repeat(download, 3, args=['http://google.com/'])