Support new Retry.DEFAULT_BACKOFF_MAX in a backwards-compatible way

This commit is contained in:
allegroai 2023-05-11 16:16:18 +03:00
parent ebb6231f5a
commit a78a25d966

View File

@ -86,7 +86,10 @@ def get_http_session_with_retry(
session = requests.Session()
if backoff_max is not None:
if "BACKOFF_MAX" in vars(Retry):
Retry.BACKOFF_MAX = backoff_max
else:
Retry.DEFAULT_BACKOFF_MAX = backoff_max
retry = Retry(
total=total, connect=connect, read=read, redirect=redirect, status=status,