Skip to content

Commit

Permalink
Change a bit import.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed Feb 24, 2015
1 parent f315706 commit 4cf041c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/aspectlib/contrib.py
@@ -1,12 +1,12 @@
from logging import getLogger
from time import sleep
import time

from aspectlib import Aspect

logger = getLogger(__name__)


def retry(func=None, retries=5, backoff=None, exceptions=(IOError, OSError, EOFError), cleanup=None, sleep=sleep):
def retry(func=None, retries=5, backoff=None, exceptions=(IOError, OSError, EOFError), cleanup=None, sleep=time.sleep):
"""
Decorator that retries the call ``retries`` times if ``func`` raises ``exceptions``. Can use a ``backoff`` function
to sleep till next retry.
Expand Down

0 comments on commit 4cf041c

Please sign in to comment.