Skip to content

Commit

Permalink
rest client: Only enable backoff_and_retry if urllib3 version is …
Browse files Browse the repository at this point in the history
…at least version `2`. (#1342)
  • Loading branch information
djgoku authored Jun 12, 2024
1 parent 876e4a9 commit ffb3fc0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from requests_oauthlib import OAuth1, OAuth2
from six.moves.urllib.parse import urlencode
from urllib3.util import Retry
import urllib3

from atlassian.request_utils import get_default_logger

Expand Down Expand Up @@ -117,7 +118,7 @@ def __init__(
self._session = requests.Session()
else:
self._session = session
if backoff_and_retry:
if backoff_and_retry and int(urllib3.__version__.split(".")[0]) >= 2:
# Note: we only retry on status and not on any of the
# other supported reasons
retries = Retry(
Expand Down

0 comments on commit ffb3fc0

Please sign in to comment.