Skip to content

Fix http.py: Exception -> exception. #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 23, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion googleapiclient/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,15 @@ def _retry_request(http, num_retries, req_type, sleep, rand, uri, method, *args,
"""
resp = None
content = None
exception = None
for retry_num in range(num_retries + 1):
if retry_num > 0:
# Sleep before retrying.
sleep_time = rand() * 2 ** retry_num
LOGGER.warning(
'Sleeping %.2f seconds before retry %d of %d for %s: %s %s, after %s',
sleep_time, retry_num, num_retries, req_type, method, uri,
resp.status if resp else Exception)
resp.status if resp else exception)
sleep(sleep_time)

try:
Expand Down