diff options
author | Jordan Cook <jordan.cook@pioneer.com> | 2022-01-01 12:02:10 -0600 |
---|---|---|
committer | Jordan Cook <jordan.cook@pioneer.com> | 2022-01-01 12:10:43 -0600 |
commit | 023b9bf36a4305f5edceece7ac6eabbd16e2e40d (patch) | |
tree | b9238fb788560d94b2602c8996873750c5273abb /requests_cache/session.py | |
parent | 347048289ed25ec847a40dc5971ee8a538b4aebf (diff) | |
download | requests-cache-023b9bf36a4305f5edceece7ac6eabbd16e2e40d.tar.gz |
Format using a more typical line length of 100
Diffstat (limited to 'requests_cache/session.py')
-rw-r--r-- | requests_cache/session.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/requests_cache/session.py b/requests_cache/session.py index 578e7c8..26c06e5 100644 --- a/requests_cache/session.py +++ b/requests_cache/session.py @@ -198,7 +198,11 @@ class CacheMixin(MIXIN_BASE): return set_response_defaults(response, actions.cache_key) def _resend( - self, request: PreparedRequest, actions: CacheActions, cached_response: CachedResponse, **kwargs + self, + request: PreparedRequest, + actions: CacheActions, + cached_response: CachedResponse, + **kwargs, ) -> AnyResponse: """Attempt to resend the request and cache the new response. If the request fails, delete the stale cache item. @@ -211,7 +215,11 @@ class CacheMixin(MIXIN_BASE): raise def _resend_and_ignore( - self, request: PreparedRequest, actions: CacheActions, cached_response: CachedResponse, **kwargs + self, + request: PreparedRequest, + actions: CacheActions, + cached_response: CachedResponse, + **kwargs, ) -> AnyResponse: """Attempt to resend the request and cache the new response. If there are any errors, ignore them and and return the stale cache item. @@ -223,7 +231,9 @@ class CacheMixin(MIXIN_BASE): response.raise_for_status() return response except Exception: - logger.warning(f'Request for URL {request.url} failed; using cached response', exc_info=True) + logger.warning( + f'Request for URL {request.url} failed; using cached response', exc_info=True + ) return cached_response def _update_revalidated_response( |