From 357f0ad2833026b995eccfe336dc83704141bea3 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Tue, 3 Sep 2024 10:34:08 +0200 Subject: [PATCH] fix: remove unreachable exception handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the unreachable ‹except› block. Since the ‹collaborators› is populated from a helper method that can produce only exceptions that are wrapped in the ogr's exceptions (handled by the metaclass), hence the ‹github.GithubException› cannot be raised. Fixes #760 Signed-off-by: Matej Focko --- ogr/services/github/project.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/ogr/services/github/project.py b/ogr/services/github/project.py index 881df96e..5b939e03 100644 --- a/ogr/services/github/project.py +++ b/ogr/services/github/project.py @@ -210,13 +210,7 @@ def get_owners(self) -> list[str]: return [self.github_repo.owner.login] def __get_collaborators(self) -> set[str]: - try: - collaborators = self._get_collaborators_with_permission() - except github.GithubException: - logger.debug( - "Current Github token must have push access to view repository permissions.", - ) - return set() + collaborators = self._get_collaborators_with_permission() usernames = [] for login, permission in collaborators.items():