Skip to content

Commit

Permalink
fix: remove unreachable exception handling
Browse files Browse the repository at this point in the history
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 <mfocko@redhat.com>
  • Loading branch information
mfocko committed Sep 4, 2024
1 parent ca18d97 commit 357f0ad
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions ogr/services/github/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 357f0ad

Please sign in to comment.