From ffb3fc03a485b1da09717c8621e9b56a27e3db1e Mon Sep 17 00:00:00 2001 From: Johnny5 Date: Wed, 12 Jun 2024 03:08:20 -0500 Subject: [PATCH] rest client: Only enable `backoff_and_retry` if `urllib3` version is at least version `2`. (#1342) --- atlassian/rest_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/atlassian/rest_client.py b/atlassian/rest_client.py index bfe1096a7..677a99313 100644 --- a/atlassian/rest_client.py +++ b/atlassian/rest_client.py @@ -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 @@ -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(