Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 988673ef0a5d2ab52c06f6cb70bffef3 > files > 17

python3-retry_decorator-1.0.0-1.mga4.noarch.rpm


Usage
-----

Retry decorator

::

    #!/usr/bin/env python

    from __future__ import print_function
    from retry_decorator import *

    @retry(Exception, tries = 3, timeout_secs = 0.1)
    def test_retry():
        import sys
        print('hello', file = sys.stderr)
        raise Exception('Testing retry')

    if __name__ == '__main__':
        try:
            test_retry()
        except Exception as e:
            print('Received the last exception')