From 9ec804f04ee24fcfcb2e445ec494300eb7a0a5c9 Mon Sep 17 00:00:00 2001 From: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:01:40 +0530 Subject: [PATCH] Fix retry decorator (#79) * Support Accounting Export Summary Bulk POST * Fix retry decorator --- fyle/platform/internals/decorators.py | 6 +++--- setup.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fyle/platform/internals/decorators.py b/fyle/platform/internals/decorators.py index 396a179..04bf67c 100644 --- a/fyle/platform/internals/decorators.py +++ b/fyle/platform/internals/decorators.py @@ -24,12 +24,12 @@ def new_fn(*args, **kwargs): while attempt < n: try: return func(*args, **kwargs) - except exceptions: - if exc.InvalidTokenError in exceptions: + except exceptions as e: + if isinstance(e, exc.InvalidTokenError): Auth().update_access_token() time.sleep(backoff) attempt += 1 - raise exc.RetryException('failed to execute %s despite retrying' % func) + raise exc.RetryException('failed to execute %s despite retrying' % func.__name__) return new_fn diff --git a/setup.py b/setup.py index d202154..858b91e 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='fyle', - version='v0.33.0', + version='v0.33.1', author='Siva Narayanan', author_email='siva@fyle.in', description='Python SDK for accessing Fyle Platform APIs',