This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
class retry(object): | |
defaultexceptions = (Exception,) | |
def __init__(self, tries=1, exceptions=None, delay=0): | |
""" | |
Decorator for retrying a function if an exception occurs | |
@source: http://peter-hoffmann.com/2010/retry-decorator-python.html (updated to dynamically override tries) | |
Usage: |