Skip to content

Commit

Permalink
support newer versions of urllib3 with backwards support too. patch b…
Browse files Browse the repository at this point in the history
…y someone else
  • Loading branch information
seb26 committed Feb 18, 2024
1 parent ec3d25d commit 0fb7e83
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions frameioclient/lib/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,20 @@ def __init__(self, threads: Optional[int] = default_thread_count):
self.shared_headers = {"x-frameio-client": f"python/{self.client_version}"}

# Configure retry strategy (very broad right now)
self.retry_strategy = Retry(
total=100,
backoff_factor=2,
status_forcelist=retryable_statuses,
method_whitelist=["GET", "POST", "PUT", "GET", "DELETE"],
)
try:
self.retry_strategy = Retry(
total=100,
backoff_factor=2,
status_forcelist=retryable_statuses,
allowed_methods=["GET", "POST", "PUT", "GET", "DELETE"],
)
except TypeError: # to save compatibility with older versions of urllib3
self.retry_strategy = Retry(
total=100,
backoff_factor=2,
status_forcelist=retryable_statuses,
method_whitelist=["GET", "POST", "PUT", "GET", "DELETE"],
)

# Create real thread
self._initialize_thread()
Expand Down

0 comments on commit 0fb7e83

Please sign in to comment.