Skip to content

Commit 16f5609

Browse files
committed
mypy fixes
1 parent be5563c commit 16f5609

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

atlassian/confluence.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import os
66
import re
77
import time
8+
from typing import cast
89

910
import requests
1011
from bs4 import BeautifulSoup
@@ -2747,7 +2748,7 @@ def get_atl_request(url: str):
27472748
try:
27482749
response = self.get(url, advanced_mode=True)
27492750
parsed_html = BeautifulSoup(response.text, "html.parser")
2750-
atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value")
2751+
atl_token = parsed_html.find("input", {"name": "atl_token"}).get("value") # type: ignore[union-attr]
27512752
return atl_token
27522753
except Exception as e:
27532754
raise ApiError("Problems with getting the atl_token for get_space_export method :", reason=e)
@@ -2799,17 +2800,18 @@ def get_atl_request(url: str):
27992800
parsed_html = BeautifulSoup(response.text, "html.parser")
28002801
# Getting the poll URL to get the export progress status
28012802
try:
2802-
poll_url = parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content")
2803+
poll_url = cast("str", parsed_html.find("meta", {"name": "ajs-pollURI"}).get("content")) # type: ignore[union-attr]
28032804
except Exception as e:
28042805
raise ApiError("Problems with getting the poll_url for get_space_export method :", reason=e)
28052806
running_task = True
28062807
while running_task:
28072808
try:
28082809
progress_response = self.get(poll_url)
2810+
assert progress_response
28092811
log.info("Space" + space_key + " export status: " + progress_response["message"])
28102812
if progress_response["complete"]:
28112813
parsed_html = BeautifulSoup(progress_response["message"], "html.parser")
2812-
download_url = parsed_html.find("a", {"class": "space-export-download-path"}).get("href")
2814+
download_url = cast("str", parsed_html.find("a", {"class": "space-export-download-path"}).get("href")) # type: ignore
28132815
if self.url in download_url:
28142816
return download_url
28152817
else:

atlassian/jira.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def download_attachments_from_issue(
302302
except Exception as e:
303303
raise e
304304

305-
def get_attachment_content(self, attachment_id: T_id) -> T_resp_json:
305+
def get_attachment_content(self, attachment_id: T_id) -> bytes:
306306
"""
307307
Returns the content for an attachment
308308
:param attachment_id: int
@@ -1791,7 +1791,7 @@ def get_issue_remote_links(
17911791
url += "/" + internal_id
17921792
return self.get(url, params=params)
17931793

1794-
def get_issue_tree_recursive(self, issue_key: str, tree: list = None, depth: int = None):
1794+
def get_issue_tree_recursive(self, issue_key: str, tree: Optional[list] = None, depth: Optional[int] = None):
17951795
"""
17961796
Returns a list that contains the tree structure of the root issue, with all subtasks and inward linked issues.
17971797
(!) Function only returns child issues from the same Jira instance or from an instance to which the API key has access.

atlassian/rest_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def __init__(
168168
else:
169169
self._session = session
170170

171-
if proxies is not None:
171+
if self.proxies is not None:
172172
self._session.proxies = self.proxies
173173

174174
if self.backoff_and_retry and self.use_urllib3_retry:

0 commit comments

Comments
 (0)