Skip to content

Commit bda4c10

Browse files
committed
Exception handling for release count
1 parent 678e8ea commit bda4c10

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

github2pandas/repository.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ def extract_repository_data(repo, contributor_companies_included = False):
120120
pulls_review_comments = "not known"
121121
print("No pull request comments")
122122

123+
try:
124+
# problem: ???
125+
release_count = repo.get_releases().totalCount,
126+
except GithubException:
127+
release_count = 0
128+
print("Wrong release count output")
129+
123130
repository_data = {
124131
'repo_name': repo_name,
125132
'organization_name' : organization_name,
@@ -142,7 +149,7 @@ def extract_repository_data(repo, contributor_companies_included = False):
142149
'milestone_count': repo.get_milestones(state="all").totalCount,
143150
'pullrequest_count': repo.get_pulls(state="all").totalCount,
144151
'pullrequest_review_count': pulls_review_comments,
145-
'release_count': repo.get_releases().totalCount,
152+
'release_count': release_count,
146153
'workflow_count': repo.get_workflows().totalCount,
147154
'readme_length': readme_length,
148155
'issues_count': repo.get_issues(state="all").totalCount,

0 commit comments

Comments
 (0)