From 6fe76015ed59c8977911c82c1537fe36e461850d Mon Sep 17 00:00:00 2001 From: Peter Thomassen <4242683+peterthomassen@users.noreply.github.com> Date: Tue, 2 Mar 2021 15:40:57 +0100 Subject: [PATCH] Fix deprecated tenacity call Since tenacity 6.0.0, `tenacity.Retrying.call` is deprecated and generates warning messages. Instead one should be calling the `Retrying` instance itself: `retrying()`. https://github.com/jd/tenacity/pull/253 This new recommended behavior was also previously supported (no breaking change). --- opsgenie_sdk/api_client.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/opsgenie_sdk/api_client.py b/opsgenie_sdk/api_client.py index bdf6422..caf7fbc 100644 --- a/opsgenie_sdk/api_client.py +++ b/opsgenie_sdk/api_client.py @@ -193,13 +193,13 @@ def __call_api( # perform request and return response try: - response_data = self.retrying.call(fn=self.request, method=method, url=url, - query_params=query_params, - headers=header_params, - post_params=post_params, - body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + response_data = self.retrying(fn=self.request, method=method, url=url, + query_params=query_params, + headers=header_params, + post_params=post_params, + body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) except Exception as exception: self._sdk_request_details = { "query_params": query_params,