Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove syntax incompatible with python 2 #1374

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion atlassian/bitbucket/cloud/repositories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def __init__(self, data, *args, **kwargs):
self.__hooks = Hooks(
"{}/hooks".format(self.url),
data={"links": {"hooks": {"href": "{}/hooks".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.__deployment_environments = DeploymentEnvironments(
Expand Down
2 changes: 1 addition & 1 deletion atlassian/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ def download_attachments_from_page(self, page_id, path=None):
if not file_name:
file_name = attachment["id"] # if the attachment has no title, use attachment_id as a filename
download_link = self.url + attachment["_links"]["download"]
r = self._session.get(f"{download_link}")
r = self._session.get(str(download_link))
file_path = os.path.join(path, file_name)
with open(file_path, "wb") as f:
f.write(r.content)
Expand Down
6 changes: 3 additions & 3 deletions atlassian/jira.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,11 @@ def download_attachments_from_issue(self, issue, path=None, cloud=True):
path = os.getcwd()
issue_id = self.issue(issue, fields="id")["id"]
if cloud:
url = self.url + f"/secure/issueAttachments/{issue_id}.zip"
url = self.url + "/secure/issueAttachments/{}.zip".format(issue_id)
else:
url = self.url + f"/secure/attachmentzip/{issue_id}.zip"
url = self.url + "/secure/attachmentzip/{}.zip".format(issue_id)
response = self._session.get(url)
attachment_name = f"{issue_id}_attachments.zip"
attachment_name = "{}_attachments.zip".format(issue_id)
file_path = os.path.join(path, attachment_name)
# if Jira issue doesn't have any attachments _session.get request response will return 22 bytes of PKzip format
file_size = sum(len(chunk) for chunk in response.iter_content(8196))
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ commands = pylint {[base]linting_targets}

[testenv:black]
basepython = python3
target-version = ["py37"]
target-version = ["py27", "py37"]
skip_install = true
deps = black
commands = black --check --diff {[base]linting_targets} --exclude __pycache__
Expand Down
Loading