Skip to content

Instantly share code, notes, and snippets.

View claytonaalves's full-sized avatar

Clayton A. Alves claytonaalves

View GitHub Profile
@claytonaalves
claytonaalves / retry_decorator.py
Created December 8, 2010 13:06 — forked from hoffmann/retry_decorator.py
Decorator para setar numero de execuções de uma função
import time
class Retry(object):
default_exceptions = (Exception)
def __init__(self, tries, exceptions=None, delay=0):
"""
Decorator for retrying function if exception occurs
tries -- num tries
exceptions -- exceptions to catch