Skip to content

Commit

Permalink
Python 2.7 compatibility (#1087)
Browse files Browse the repository at this point in the history
  • Loading branch information
orent authored Nov 28, 2022
1 parent e183226 commit 991e2c2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion atlassian/bamboo.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def results(
elements_key="results",
element_key="result",
label=label,
**params,
**params
)

def latest_results(
Expand Down
2 changes: 1 addition & 1 deletion atlassian/bitbucket/cloud/repositories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def __init__(self, data, *args, **kwargs):
self.__commits = Commits(
"{}/commits".format(self.url),
data={"links": {"commit": {"href": "{}/commit".format(self.url)}}},
**self._new_session_args,
**self._new_session_args
)
self.__default_reviewers = DefaultReviewers("{}/default-reviewers".format(self.url), **self._new_session_args)
self.__issues = Issues("{}/issues".format(self.url), **self._new_session_args)
Expand Down
7 changes: 5 additions & 2 deletions atlassian/rest_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
from json import dumps

import requests
from oauthlib.oauth1 import SIGNATURE_RSA_SHA512
try:
from oauthlib.oauth1 import SIGNATURE_RSA_SHA512 as SIGNATURE_RSA
except ImportError:
from oauthlib.oauth1 import SIGNATURE_RSA_SHA512
from requests import HTTPError
from requests_oauthlib import OAuth1, OAuth2
from six.moves.urllib.parse import urlencode
Expand Down Expand Up @@ -103,7 +106,7 @@ def _create_oauth_session(self, oauth_dict):
oauth = OAuth1(
oauth_dict["consumer_key"],
rsa_key=oauth_dict["key_cert"],
signature_method=SIGNATURE_RSA_SHA512,
signature_method=SIGNATURE_RSA,
resource_owner_key=oauth_dict["access_token"],
resource_owner_secret=oauth_dict["access_token_secret"],
)
Expand Down

0 comments on commit 991e2c2

Please sign in to comment.