From d97be6521a484fc03f6429006e310983811128d1 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Thu, 9 Nov 2023 09:09:26 -0500 Subject: [PATCH] Fix type-checking failures --- src/tinuous/github.py | 2 +- src/tinuous/travis.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tinuous/github.py b/src/tinuous/github.py index 7cd6338..6f4187e 100644 --- a/src/tinuous/github.py +++ b/src/tinuous/github.py @@ -327,7 +327,7 @@ def download(self, path: Path) -> list[Path]: try: self.client.download_zipfile(self.logs_url, path) except requests.HTTPError as e: - if e.response.status_code in (404, 410): + if e.response is not None and e.response.status_code in (404, 410): # 404 can happen when a workflow failed to run due to, say, a # syntax error. 410 happens when the logs have expired. log.error( diff --git a/src/tinuous/travis.py b/src/tinuous/travis.py index 0a4c45d..4d9985d 100644 --- a/src/tinuous/travis.py +++ b/src/tinuous/travis.py @@ -68,7 +68,7 @@ def get_github_commit(self, commit_sha: str) -> Optional[Commit]: try: r = self.ghclient.get(f"/repos/{self.repo}/commits/{commit_sha}") except requests.HTTPError as e: - if e.response.status_code == 404: + if e.response is not None and e.response.status_code == 404: return None else: raise e